What is the difference between Iterator and SplitIterator

In this post, I will be explaining the difference between a Iterator and SplitIterator.

Edit
IteratorSplitIterator
Present in Java right from the startAdded by Java 8
Allows iterating over the elements of a collection individuallyAllows iterating over the elements of a collection individually as well as in bulk
Can be used only for iterating over a CollectionCan be used to iterate over a Stream as well as a Collection
Only allows sequential processingAllows both sequential as well as parallel processing

 

Comments

Popular posts from this blog

Java 11 String enhancements with examples

How to add Maven dependencies via Eclipse

JPA/Hibernate Inheritance Mapping Strategies Explained