The iterator is a useful structure to iterate over collections (List, Set, Map, Seq). But it you uses the method size, you might notice an strange behavior, the iterator seems to be empty.
Let’s understand why.
Full Stack notes and tips for developers… Java, React, Kubernetes, Scala, and more…
The iterator is a useful structure to iterate over collections (List, Set, Map, Seq). But it you uses the method size, you might notice an strange behavior, the iterator seems to be empty.
Let’s understand why.