- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 1070 Articles
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
2K+ Views
To get data from MySQL database, you need to use executeQuery() method from java. First create a table in the MySQL database. Here, we will create the following table in the ‘sample’ databasemysql> create table javaGetDataDemo - > ( - > Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, - > ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
499 Views
The addIfAbsent() method appends the element if it is not in the list. If the element is already in the list, then FALSE is returned.The syntax is as follows.public boolean addIfAbsent(E ele)Here, ele is the element to be added to this list, if it is not already in the list.To ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
84 Views
This example demonstrate about How to get default phone MmsUserAgent 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](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
509 Views
You need to use insert() for this. Whenever you insert custom _id values and the document already exist with the custom _id value then an error is visible. Let us first create a collection with documents. Under this, we tried adding the same document again and this resulted in an error> ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
212 Views
A class constructor is a special member function of a class that is executed whenever we create new objects of that class.A constructor will have exact same name as the class and it does not have any return type at all, not even void. Constructors can be very useful for ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
438 Views
Let us first create a table. The query to create a table is as followsmysql> create table selectAllDemo - > ( - > Name varchar(100), - > Age int - > ); Query OK, 0 rows affected (1.90 ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
1K+ Views
Following is the syntax to return only a single property _id in MongoDBdb.yourCollectionName.find({}, {"_id": 1}).pretty();Let us first create a collection with documents> db.singlePropertyIdDemo.insertOne({"_id":101, "UserName":"Larry", "UserAge":21}); { "acknowledged" : true, "insertedId" : 101 } > db.singlePropertyIdDemo.insertOne({"_id":102, "UserName":"Mike", "UserAge":26}); { "acknowledged" : true, "insertedId" : 102 } > db.singlePropertyIdDemo.insertOne({"_id":103, "UserName":"Chris", "UserAge":24}); { ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
509 Views
The syntax is as follows to rename Root @localhostUPDATE MySQL.user SET user = ‘yourNewRootName’ WHERE user = 'root';To understand the above concept, let us check all the user names and host. The query is as followsmysql> select user, host from MySQL.user;The following is the output+------------------+-----------+ | user ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
230 Views
In this section we will see how we can sort some array or linked list using standard library of C++. In C++ there are multiple different libraries that can be used for different purposes. The sorting is one of them.The C++ function std::list::sort() sorts the elements of the list in ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
219 Views
The toString() method of the AbstractCollection class is used to return the string representation of the elements of this collection.The syntax is as followspublic String toString()To work with AbstractCollection class in Java, import the following packageimport java.util.AbstractCollection;The following is an example to implement AbstractCollection toString() method in JavaExample Live Demoimport java.util.ArrayList; ... Read More