![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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
AmitDiwan has Published 11365 Articles
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
119 Views
Let’s say the following is our Set −Set set = new HashSet(Arrays.asList(15, 40, 60, 90, 120, 150, 200));Now, create a method to convert the above set to stream.StreamstreamOfInteger = convertSet(set);The method −private static Stream convertSet(Set set) { return set.stream(); }ExampleFollowing is the program to convert a Set to ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
409 Views
At first, create a Map and set values −Map map = new HashMap(); map.put(1, "Kevin"); map.put(2, "Ryan"); map.put(3, "Nathan"); map.put(4, "Ricky"); map.put(5, "Shane"); map.put(6, "Adam");Now, convert the Map to Stream −Stream stream = map.entrySet().stream(); System.out.println("Stream (Map to Stream) = "+ Arrays.toString(stream.toArray()));ExampleFollowing is the program to convert a Map to a ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
207 Views
The introduction of Java 7 enhanced the switch case i.e. it support string as well.At first, set a string −String department = "AKD05";Now, use the same string in switch as shown below −switch(department)ExampleNow, check for every string using case as we normally do while using SWITCH CASE. Following is an ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
491 Views
The distinct() method of the stream class returns a stream consisting of the distinct elements of this stream. The syntax is as following −Stream distinct()ExampleFollowing is an example to implement the distinct() method in the Stream class −import java.util.*; public class Demo { public static void main(String[] args) { ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
626 Views
Let us first create a table −mysql> create table DemoTable1 ( Name varchar(100), Gender ENUM('MALE', 'FEMALE') ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 values('Chris', 'Male'); Query OK, 1 row affected (0.17 sec) mysql> insert into ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
95 Views
Let us first create a table −mysql> create table DemoTable ( Title text ); Query OK, 0 rows affected (0.39 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Introduction to MySQL'); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable values('Introduction to ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
158 Views
To display, use DESC command or information_schema.columns. Let us first create a table and set options −mysql> create table DemoTable ( Color SET('RED', 'GREEN', 'BLUE', 'YELLOW') ); Query OK, 0 rows affected (0.47 sec)Case 1Here is the query to get the list of available options for SET using the ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
810 Views
To insert random numbers, use RAND() function from MySQL. Let us first create a table −mysql> create table DemoTable ( Value int ); Query OK, 0 rows affected (0.46 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.15 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
95 Views
To delete a record in the required way, the syntax is as follows −delete from yourTableName where yourTableName .yourColumnName=yourValue;Let us first create a table −mysql> create table DemoTable ( StudentName varchar(100), StudentAge int ); Query OK, 0 rows affected (0.81 sec)Insert some records in the table using insert ... Read More