If I have a collection, such as Collection<String> strs
, how can I get the first item out? I could just call an Iterator
, take its first next()
, then throw the Iterator
away. Is there a less wasteful way to do it?
If I have a collection, such as Collection<String> strs
, how can I get the first item out? I could just call an Iterator
, take its first next()
, then throw the Iterator
away. Is there a less wasteful way to do it?