67
Java Vector spliterator() Method
The spliterator() method of Java Vector class is used to create a late-binding and fail-fast spliterator over the elements in this list.
Syntax
Following is the declaration of spliterator() method:
Parameter
This method does not accept any parameter.
Return
The spliterator() method returns a spliterator over the elements in the list.
Exceptions
NA
Compatibility Version
Java 1.8 and above
Example 1
Output:
Estimated size: 4 Contents of vector: 10 30 20 40
Example 2
Output:
Estimated size: 5 Contents of vector: One Two Three Four Five
Next TopicVector subList()