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.
Category: Scala
Using collect in Scala
An advantage of Scala to Java is the number of method to use on collections (List, Seq, Buffer, etc), and implement the functional programming approach simplifying our code. In this article, we will understand the usage of the collect method and its benefits.
Continue reading