- 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
Found 4332 Articles for Java 8
![Daniol Thomas](https://www.tutorialspoint.com/assets/profiles/13551/profile/60_130035-1512726078.jpg)
60 Views
To create a Decade Tuple in Java, you can use the with() 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 package.import org.javatuples.Decade;Note: Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project → Properties → Java Build Path → Add External Jars and upload the downloaded JavaTuples jar file. Refer the below guide for all the steps to run JavaTuples.Steps: How to run JavaTuples program in EclipseThe following is an example to create Decade Tuple ... Read More
![Daniol Thomas](https://www.tutorialspoint.com/assets/profiles/13551/profile/60_130035-1512726078.jpg)
83 Views
The listIterator() method of the AbstractList class in Java is used to return a list iterator over the elements in this list.The syntax is as follows.public ListIterator listIterator()Here, ListIterator is an iterator for lists.To work with the AbstractList class, import the following package.import java.util.AbstractList;For ListIterator, import the following package.import java.util.ListIterator;The following is an example to implement listIterator() method of the AbstractlList class in Java.Example Live Demoimport java.util.ArrayList; import java.util.ListIterator; import java.util.AbstractList; public class Demo { public static void main(String[] args) { AbstractList myList = new ArrayList(); myList.add(75); myList.add(100); ... Read More
![Daniol Thomas](https://www.tutorialspoint.com/assets/profiles/13551/profile/60_130035-1512726078.jpg)
74 Views
The listIterator() method of the AbstractList class in Java is used to return a list iterator over the elements in this list, beginning at the specified position in the list.The syntax is as follows.public ListIterator listIterator(int index)Here, index is the index of the first element to be returned from the list iterator, whereas, ListIterator is an iterator for lists.To work with the AbstractList class, import the following package.import java.util.AbstractList;For ListIterator, import the following package.import java.util.ListIterator;The following is an example to implement listIterator() method of the AbstractlList class in Java.Example Live Demoimport java.util.ArrayList; import java.util.ListIterator; import java.util.AbstractList; public class Demo { ... Read More
![Daniol Thomas](https://www.tutorialspoint.com/assets/profiles/13551/profile/60_130035-1512726078.jpg)
168 Views
The iterator() method of the ArrayBlockingQueue class returns an iterator over the elements in this queue in proper sequence.The syntax is as follows.public Iterator iterator()To work with ArrayBlockingQueue class, you need to import the following package.import java.util.concurrent.ArrayBlockingQueue;The following is an example to implement iterator() method of Java ArrayBlockingQueue class.Example Live Demoimport java.util.ArrayList; import java.util.Iterator; import java.util.concurrent.ArrayBlockingQueue; public class Demo { public static void main(String[] args) throws InterruptedException { ArrayBlockingQueue q = new ArrayBlockingQueue(10); q.add(120); q.add(10); q.add(400); q.add(450); q.add(500); q.add(550); ... Read More
![Daniol Thomas](https://www.tutorialspoint.com/assets/profiles/13551/profile/60_130035-1512726078.jpg)
784 Views
The collectingAndThen() method in Java Collectors class acclimates a Collector to perform an additional finishing transformation. It returns collector which performs the action of the downstream collector, followed by an additional ending step.The syntax is as follows.static Collector collectingAndThen(Collector downstream, Function finisher)Here, the parameter, T − Type of the input elementsA − Intermediate accumulation type of the downstream collectorR − The result type of the downstream collectorRR − The result type of the resulting collectordownstream − Collectorfinisher − A function to be applied to the final result of the downstream collectorTo work with Collectors class in Java, import the ... Read More
![Daniol Thomas](https://www.tutorialspoint.com/assets/profiles/13551/profile/60_130035-1512726078.jpg)
540 Views
The mapToLong() function in IntStream class returns a LongStream consisting of the results of applying the given function to the elements of this stream.The syntax is as follows.LongStream mapToLong(IntToLongFunction mapper)Here, the parameter mapper is a stateless function to apply to each element.Create an IntStream with some elements in the Stream.IntStream intStream = IntStream.of(50, 100, 150, 200);Now create a LongStream and use the mapToLong() with a condition.LongStream longStream = intStream.mapToLong(num → (long)num);The following is an example to implement IntStream mapToLong() method in Java.Exampleimport java.util.*; import java.util.stream.IntStream; import java.util.stream.LongStream; public class Demo { public static void main(String[] args) { ... Read More
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
102 Views
The iterator() method of the LongStream class in Java returns an iterator for the elements of this stream.The syntax is as follows.PrimitiveIterator.OfLong iterator()Here, PrimitiveIterator is an Iterator specialized for long values.To use the LongStream class in Java, import the following package.import java.util.stream.LongStream;The following is an example to implement LongStream iterator() method in Java.Example Live Demoimport java.util.*; import java.util.stream.LongStream; public class Demo { public static void main(String[] args) { LongStream longStream = LongStream.of(15000L, 17000L, 25000L); PrimitiveIterator.OfLong i = longStream.iterator(); while (i.hasNext()) { System.out.println(i.nextLong()); } ... Read More
![Nancy Den](https://www.tutorialspoint.com/assets/profiles/13557/profile/60_88439-1512714529.jpg)
61 Views
You can easily create Octet Tuple in Java using with() method. Let us first see what we need to work with JavaTuples. To work with Octet class in JavaTuples, you need to import the following package.import org.javatuples.Octet;Note: Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project → Properties → Java Build Path → Add External Jars and upload the downloaded JavaTuples jar file. Refer the below guide for all the steps to run JavaTuples.Steps: How to run JavaTuples program in EclipseThe following is an example to create Octet Tuple using with() ... Read More