Joe Soltzberg

64%
Flag icon
• Destructive filtering—If you need to traverse a collection removing selected elements, then you need to use an explicit iterator so that you can call its remove method. You can often avoid explicit traversal by using Collection’s removeIf method, added in Java 8.
Joe Soltzberg
Depending on how you remove (if it's efficient O(1)) and if the cost of copying the list isn't large, that could be an alternative
Effective Java
Rate this book
Clear rating
Open Preview