GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — ArrayDeque spliterator() method in Java - GeeksforGeeks ArrayDeque spliterator() method in JavaLast Updated : 11 Jul, 2025 The spliterator() method of ArrayDeque returns a Spliterator of the same elements as ArrayDeque but created Spliterator is late-binding and fail-fast. A late-binding Spliterator binds to the source of elements means ArrayDeque at the point of first traversal, first split, or first query for estimated size, rather than at the time the Spliterator is created. It can be used with Streams in Java 8. Also it can traverse elements individually and in bulk too. Spliterator is better way to traverse over element because it provides more control on elements.
Syntax:
public Spliterator<E> spliterator()Returns: This method returns a Spliterator over the elements in ArrayDeque. Below programs illustrate spliterator() method of ArrayDeque: Example 1: To demonstrate spliterator() method on ArrayDeque which contains a list of Numbers.
Output:
Example 2: To demonstrate spliterator() method on ArrayDeque which contains list of Strings.
list of Numbers: 1234 2345 3456 4567
Output:
Reference:
https://docs.oracle.com/javase/10/docs/api/java/util/ArrayDeque.html#spliterator()list of Cities: City Name: Kolkata City Name: Delhi City Name: Mumbai City Name: Jaipur Comment Explore |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |