Ankith Reddy has Published 1070 Articles

What is a request object in JSP?

Ankith Reddy

Ankith Reddy

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

872 Views

The request object is an instance of a javax.servlet.http.HttpServletRequest object. Each time a client requests a page, the JSP engine creates a new object to represent that request.The request object provides methods to get HTTP header information including form data, cookies, HTTP methods, etc.Following is the example which uses getHeaderNames() ... Read More

How to convert HASHMAP to JSON using GSON in Android?

Ankith Reddy

Ankith Reddy

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

988 Views

GSON is java library, It is used to convert OBJECT to JSON and JSON to Object. Internally it going to work based on serialization and deserialization.This example demonstrates how to convert HASHAMP to JSON using GSON library.Step 1 − Create a new project in Android Studio, go to File ⇒ ... Read More

C++ Program to Represent Graph Using 2D Arrays

Ankith Reddy

Ankith Reddy

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

1K+ Views

This is a C++ program represents a graph using 2D arrays.The time complexity of this algorithm is O(v*v).AlgorithmBegin Take the input of the number of vertex ‘v’ and edges ‘e’. Assign memory to the graph[][] matrix. Take the input of ‘e’ ... Read More

How to hide action bar in android?

Ankith Reddy

Ankith Reddy

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

706 Views

This example demonstrate about How to hide action bar in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     In the above ... Read More

DoubleStream filter() method in Java

Ankith Reddy

Ankith Reddy

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

87 Views

The filter() method of the DoubleStream class returns a stream consisting of the elements of this stream that match the given predicate.The syntax is as followsDoubleStream filter(DoublePredicate predicate)The parameter predicate is a stateless predicate to apply to each element to determine if it should be included.To use the DoubleStream class ... Read More

LongStream concat() method in Java

Ankith Reddy

Ankith Reddy

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

66 Views

The concat() method in the LongStream class creates a concatenated stream whose elements are all the elements of the first stream followed by all the elements of the second stream.The syntax is as follows.static LongStream concat(LongStream one, LongStream two)Here, parameter one is the 1st stream, whereas two is the 2nd ... Read More

How to find a record by _id in MongoDB?

Ankith Reddy

Ankith Reddy

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

601 Views

In order to find record by _id in MongoDB, you can use the following syntaxdb.yourCollectionName.find({"_id":yourObjectId});Let us create a collection with documents> db.findRecordByIdDemo.insertOne({"CustomerName":"Larry", "CustomerAge":26}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9dc2c875e2eeda1d5c3671") } > db.findRecordByIdDemo.insertOne({"CustomerName":"Bob", "CustomerAge":20}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9dc2d175e2eeda1d5c3672") } > db.findRecordByIdDemo.insertOne({"CustomerName":"Carol", "CustomerAge":22}); { ... Read More

DoubleStream of() method in Java

Ankith Reddy

Ankith Reddy

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

143 Views

The DoubleStream class in Java the following two forms of the of() methodThe following of() method returns a sequential DoubleStream containing a single element. Here is the syntaxstatic DoubleStream of(double t)Here, parameter t is the single element.The following of() method returns a sequential ordered stream whose elements are the specified ... Read More

MySQL query to GROUP BY multiple columns

Ankith Reddy

Ankith Reddy

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

643 Views

You can use IF() to GROUP BY multiple columns. To understand the concept, let us create a table. The query to create a table is as followsmysql> create table MultipleGroupByDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> CustomerId int,    -> ProductName varchar(100) ... Read More

What is a response object in JSP?

Ankith Reddy

Ankith Reddy

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

987 Views

The response object is an instance of a javax.servlet.http.HttpServletResponse object. Just as the server creates the request object, it also creates an object to represent the response to the client.The response object also defines the interfaces that deal with creating new HTTP headers. Through this object, the JSP programmer can ... Read More

Advertisements