
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Ankith Reddy has Published 996 Articles

Ankith Reddy
103 Views
The listIterator() method of the AbstractSequentialList class returns a list iterator over the elements in this list.The syntax is as followspublic abstract ListIterator listIterator(int index)Here, index is the index of the first element to be returned from the list iterator. The ListIterator here is the iterator for lists.To work with ... Read More

Ankith Reddy
501 Views
To get distinct values and count them, you can use GROUP BY clause.The syntax is as followsselect yourColumnName, count(*) as anyAliasName from yourTableName group by yourColumnName;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table GroupByAndCountDemo -> ( ... Read More

Ankith Reddy
1K+ Views
In order to insert Date() in MongoDB through Mongo shell, use the following syntaxvar yourVariableName= new Date(year, month, day, hour, minute); db.yourCollectionName({yourDateFieldName:yourVariableName});Let us first create a date variable> var creatingDate = new Date(2019, 03, 29, 13, 12);Let us create a collection with documents:>db.insertingDateUsingVariableDemo.insertOne({"UserName":"John", "UserMessages":["Hi", "Hello", "Awesome"], "UserPostDate":creatingDate});Following is the query ... Read More

Ankith Reddy
131 Views
The contains() method of AbstractSequentialList in Java is used to check whether an element is in the Collection.The syntax is as followspublic boolean contains(Object ob)Here, ob is the element to be checked. To work with the AbstractSequentialList class in Java, you need to import the following packageimport java.util.AbstractSequentialList;The following is ... Read More

Ankith Reddy
2K+ Views
Yes, to retrieve multiple docs from MongoDB by id, use the $in operator. The syntax is as followsdb.yourCollectionName.find({_id:{$in:[yourValue1, yourValue2, yourValue3, ...N]}});Let us first create a collection with documents:> db.retrieveMultipleDocsByIdDemo.insertOne({"_id":10, "CustomerName":"John"}); { "acknowledged" : true, "insertedId" : 10 } > db.retrieveMultipleDocsByIdDemo.insertOne({"_id":14, "CustomerName":"Chris"}); { "acknowledged" : true, "insertedId" : 14 } > ... Read More

Ankith Reddy
1K+ 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

Ankith Reddy
1K+ 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

Ankith Reddy
893 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

Ankith Reddy
126 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

Ankith Reddy
102 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