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?

14 Answers
14

Leave a Reply

Your email address will not be published. Required fields are marked *