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

How to use logging in SpringBoot with code samples

Python While Loop with code samples

How to convert a List to a Set