Ankith Reddy has Published 1070 Articles

What's the difference between assignment operator and copy constructor in C++?

Ankith Reddy

Ankith Reddy

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

564 Views

The Copy constructor and the assignment operators are used to initialize one object to another object. The main difference between them is that the copy constructor creates a separate memory block for the new object. But the assignment operator does not make new memory space. It uses reference variable to ... Read More

What is Radio Group in android?

Ankith Reddy

Ankith Reddy

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

225 Views

Before getting into example, we should know, What is radio group in android. Radio Group contains group of radio buttons. Using radio buttons we can select and un select according to user requirements.This example demonstrate about how to use radio group in android.Step 1 − Create a new project in ... Read More

How to return only value of a field in MongoDB?

Ankith Reddy

Ankith Reddy

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

796 Views

In order to return only value of a field in MongoDB, you need to write a query and use forEach loop. Let us first create a collection with documents> db.returnOnlyValueOfFieldDemo.insertOne({"ClientName":"Larry"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ea537d628fa4220163b6e") } > db.returnOnlyValueOfFieldDemo.insertOne({"ClientName":"Chris"}); {    "acknowledged" : true,    "insertedId" : ... Read More

ArrayBlockingQueue size() Method in Java

Ankith Reddy

Ankith Reddy

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

85 Views

To get the number of elements in the queue, use the size() method of the ArrayBlockingQueue class.The syntax is as followsint size()To work with ArrayBlockingQueue class, you need to import the following packageimport java.util.concurrent.ArrayBlockingQueue;The following is an example to implement size() method of Java ArrayBlockingQueue classExample Live Demoimport java.util.concurrent.ArrayBlockingQueue; public class ... Read More

What is the use of Cookie or hidden fields in JSP?

Ankith Reddy

Ankith Reddy

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

487 Views

CookiesA webserver can assign a unique session ID as a cookie to each web client and for subsequent requests from the client they can be recognized using the received cookie.This may not be an effective way as the browser at times does not support a cookie. It is not recommended ... Read More

Copy constructor vs assignment operator in C++

Ankith Reddy

Ankith Reddy

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

3K+ Views

The Copy constructor and the assignment operators are used to initializing one object to another object. The main difference between them is that the copy constructor creates a separate memory block for the new object. But the assignment operator does not make new memory space. It uses the reference variable ... Read More

SELECT a FLOAT with given precision in MySQL

Ankith Reddy

Ankith Reddy

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

1K+ Views

You can use ROUND() function.The syntax is as followsSELECT ROUND(yourColumnName, yourPrecisionIntegerValue) from yourTableName;To understand the concept, let us create a table. The query to create a table is as followsmysql> create table givenPrecisionDemo -> ( -> Amount float -> ); Query ... Read More

How to determine whether a field exists in MongoDB?

Ankith Reddy

Ankith Reddy

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

110 Views

You need to use $exists operator to determine whether a field exists in MongoDB. Let us first create a collection with documents> db.determineFieldExistsDemo.insertOne({"ClientName":"John"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9eb245d628fa4220163b75") } > db.determineFieldExistsDemo.insertOne({"ClientName":"Larry", "ClientAge":23}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9eb25cd628fa4220163b76") } > db.determineFieldExistsDemo.insertOne({"ClientName":"Mike", "ClientCountryName":"UK"}); { ... Read More

The contains() method of the Java KeyValue Tuple

Ankith Reddy

Ankith Reddy

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

67 Views

Use the contains() method to search for a value in the KeyValue tuple. Let us first see what we need to work with JavaTuples. To work with KeyValue class in JavaTuples, you need to import the following package.import org.javatuples.KeyValue;Note Download JavaTuples Jar library to run JavaTuples program. If you are ... Read More

How to delete Session data in JSP?

Ankith Reddy

Ankith Reddy

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

4K+ Views

When you are done with a user's session data, you have several options −Remove a particular attribute − You can call the public void removeAttribute(String name) method to delete the value associated with the particular key.Delete the whole session − You can call the public void invalidate() method to discard ... Read More

Advertisements