Smita Kapse has Published 560 Articles

Const Qualifier in C

Smita Kapse

Smita Kapse

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

2K+ Views

We use the const qualifier to declare a variable as constant. That means that we cannot change the value once the variable has been initialized. Using const has a very big benefit. For example, if you have a constant value of the value of PI, you wouldn't like any part ... Read More

Collectors averagingInt() method in Java 8

Smita Kapse

Smita Kapse

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

670 Views

The averagingInt() method of the Collectors class returns a Collector that produces the arithmetic mean of a int-valued function applied to the input elements.The syntax is as follows −static Collector averagingInt(ToIntFunction

What's the difference between __PRETTY_FUNCTION__, __FUNCTION__, __func__ in C/C++?

Smita Kapse

Smita Kapse

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

1K+ Views

Here we will see what are the differences between __FUNCTION__, __func__ and the __PRETTY_FUNCTION__ in C++.Basically the __FUNCTION__ and __func__ are same. Some old versions of C and C++ supports __func__. This macro is used to get the name of the current function. The _PRETTY_FUNCTION__ is used to return the ... Read More

How to create MongoDB stored procedure?

Smita Kapse

Smita Kapse

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

948 Views

The following is the syntax to create MongoDB stored procedure −db.system.js.save (    {       _id:"yourStoredProcedueName",       value:function(argument1, ....N)       {          statement1,          .          .          N       ... Read More

Modulus of Negative Numbers in C

Smita Kapse

Smita Kapse

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

949 Views

Here we will see what will be the result if we use negative numbers to get the modulus. Let us see the following programs and their outputs to get the idea.Example#include int main() {    int a = 7, b = -10, c = 2;    printf("Result: %d", a % ... Read More

How to use AND Conjunctive Operators in Android sqlite?

Smita Kapse

Smita Kapse

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

70 Views

Before getting into example, we should know what sqlite data base in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to ... Read More

What is difference between int and const int& in C/C++?

Smita Kapse

Smita Kapse

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

3K+ Views

Here we will see what are the differences between int and const_int& in C or C++.The int is basically the type of integer type data. And const is used to make something constant. If there is int& constant, then it indicates that this will hold the reference of some int ... Read More

Structure Sorting in C++

Smita Kapse

Smita Kapse

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

1K+ Views

Here we will see how to sort using some condition on some member variables of the structure in C++. In this example we will take a structure called book. The book will hold name, number of pages, and price. We will sort them based in the price.For comparing two structures, ... Read More

The toArray() method of CopyOnWriteArrayListin Java

Smita Kapse

Smita Kapse

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

58 Views

The toArray() method is used to return an array containing all the elements in this list in proper sequence.The syntax is as follows −Object[] toArray()To work with CopyOnWriteArrayList class, you need to import the following package −import java.util.concurrent.CopyOnWriteArrayList;The following is an example to implement CopyOnWriteArrayList class toArray() method in Java−Example Live ... Read More

Compound Literals in C

Smita Kapse

Smita Kapse

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

436 Views

In this section we will see what is the compound literals in C. The compound literals are introduced in C99 standard in C. Using this feature, it can create unnamed objects. In the following example we will see how to use compound literal to generate object without any name.Example#include struct ... Read More

Advertisements