Anvi Jain has Published 629 Articles

Check input character is alphabet, digit or special character in C

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

2K+ Views

In this section, we will see how to check whether a given character is number, or the alphabet or some special character in C.The alphabets are from A – Z and a – z, Then the numbers are from 0 – 9. And all other characters are special characters. So ... Read More

Inheritance in C++ vs Java

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

1K+ Views

In C++ and Java, there are the concept of Inheritance. The inheritance properties are used to reuse the code and also make a relationship between two objects. Here we will see some basic differences between inheritance in C++ and inheritance in Java.In Java, all of the classes are extending the ... Read More

How to insert an 8-byte integer into MongoDB through JavaScript shell?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

180 Views

You can use below syntax for inserting an 8-byte integer in MongoDB through JavaScript shell −anyVariableName= {"yourFieldName" : new NumberLong("yourValue")};To display the above variable, you can use the variable name or printjson(). Following is the query to insert 8 byte integer in MongoDB −> userDetail = {"userId" : new NumberLong("98686869")}; ... Read More

How to change header background color of a table in Java

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

1K+ Views

To change header background color, at first get the header background −JTableHeader tableHeader = table.getTableHeader();Now, set the background color using set Background() −tableHeader.setBackground(Color.black);Above, we have used the Color class to set the color.The following is an example to change the header background color of a JTable −Examplepackage my; import java.awt.Color; ... Read More

How to get primary key value (auto-generated keys) from inserted queries using JDBC?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

4K+ Views

If you insert records into a table which contains auto-incremented column, using a Statement or, PreparedStatement objects.You can retrieve the values of that particular column, generated by them object using the getGeneratedKeys() method.ExampleLet us create a table with name sales in MySQL database, with one of the columns as auto-incremented, using ... Read More

Simulating final class in C++

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

364 Views

In Java or C#, we can use final classes. The final classes are special type of class. We cannot extend that class to create another class. In C++ there are no such direct way. Here we will see how to simulate the final class in C++.Here we will create one ... Read More

MongoDB query to fetch elements between a range excluding both the numbers used to set range?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

1K+ Views

Let’s say both the numbers are 50 and 60. You can use below syntax −db.yourCollectionName.find({yourFieldName: { $gt : 50 , $lt : 60 } } );If you want to include 50 and 60 also then use below syntax −db.yourCollectionName.find({yourFieldName: { $gte : 50 , $lte : 60 } } );Let ... Read More

Difference between set, multiset, unordered_set, unordered_multiset in C++

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

245 Views

Here we will see what are the differences for set, multiset, unordered_set and unordered_multiset in C++. Let us see the properties of them using some example.SetThe properties of set are like belowStores data in sorted orderStores only unique valuesWe can insert or delete data, but cannot change the dataWe can ... Read More

Is it Possible to store and retrieve boolean values in a VARCHAR2 column in a table using JDBC?

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

457 Views

Yes, in Oracle you can store and retrieve a boolean value into a table for a column with VARCHAR2 datatype.If you do so, the true and false values are stored as 1 and 0 and the retrieved as same (respectively).ExampleLet us create a table with name sampleTable in the Oracle ... Read More

Function overloading and const keyword in C++

Anvi Jain

Anvi Jain

Updated on 30-Jul-2019 22:30:26

399 Views

In C++, we can overload functions. Some functions are normal functions; some are constant type functions. Let us see one program and its output to get the idea about the constant functions and normal functions.Example#include using namespace std; class my_class {    public:       void my_func() const {          cout

Advertisements