Java Interview Questions

What is the difference between Iterator and SplitIterator

Posted On
Posted By admin

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

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

 

If you like this post, please do let me know via the comments box below.  You can also connect with me via my Facebook Page or subscribe to my Youtube channel!

Related Post

leave a Comment