I have a Collection
and need to get the Nth element as returned by its Iterator
. I know I can iterate while counting through its Iterator
elements. Is there a third party library (Google Guava or Apache Commons) that does this?
Guava's Iterators.get
can help
Advances iterator position + 1 times, returning the element at the positionth position.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With