- 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
Nancy Den has Published 330 Articles
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
Nancy Den
68 Views
To create Decade Tuple from array in Java, use the fromArray() method. Here, we will see how to create a Decade Tuple using the fromArray() method. Let us first see what we need to work with JavaTuples. To work with Decade class in JavaTuples, you need to import the following ... Read More
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
Nancy Den
86 Views
The generate() method of the LongStream class returns an infinite sequential unordered stream where each element is generated by the provided LongSupplier.The syntax is as follows:static LongStream generate(LongSupplier s)Here, s is the LongSupplier for generate elements. The LongSupplier is the supplier of long-valued results.To use the LongStream class in Java, ... Read More
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
Nancy Den
68 Views
To create a KeyValue tuple in Java, you can use the with() method. 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
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
Nancy Den
82 Views
The builder() method in IntStream class is used to return a builder for an IntStream.The syntax is as follows:static IntStream.Builder builder()Here, we have created an IntStream and used the builder() method. An element is added using add() method:IntStream intStream = IntStream.builder().add(25).build();The following is an example to implement IntStream builder() method ... Read More
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
Nancy Den
131 Views
The hash code for a particular Instant object can be obtained using the hashCode() method in the Instant class in Java. This method requires no parameters and it returns the hash code for the Instant object.A program that demonstrates this is given as followsExample Live Demoimport java.time.*; import java.time.temporal.ChronoUnit; public class ... Read More
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
Nancy Den
119 Views
You can also generate Infinite Stream of Integers in Java with IntStream.generate() method. Here, we have used the Random class to get the list of random integers:Random r = new Random();After that use IntStream.generate() and the nextInt() method gets the next random integer:IntStream.generate(r::nextInt)The following is an example displaying how to ... Read More
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
Nancy Den
804 Views
The equality of two Instant objects can be determined using the equals() method in the Instant class in Java. This method requires a single parameter i.e. the Instant to be compared. Also it returns true if both the Instant objects are equal and false otherwise.A program that demonstrates this is ... Read More
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
Nancy Den
2K+ Views
Two Instant objects can be compared using the compareTo() method in the Instant class in Java. This method requires a single parameter i.e. the Instant object to be compared.If the first Instant object is greater than the second Instant object it returns a positive number, if the first Instant object ... Read More
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
Nancy Den
90 Views
An Instant can be combined with a timezone to create a ZonedDateTime object using the atZone() method in the Instant class in Java. This method requires a single parameter i.e. the ZoneID and it returns the ZonedDateTime object.A program that demonstrates this is given as followsExample Live Demoimport java.time.*; public class ... Read More
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
Nancy Den
5K+ Views
To connect with a database, you need toRegister the Driver: Select the required database, register the Driver class of the particular database using the registerDriver() method of the DriverManager class or, the forName() method of the class named Class.DriverManager.registerDriver(new com.mysql.jdbc.Driver());Get connection: Create a connection object by passing the URL of ... Read More