One of my favorite changes in Java 8, default methods on interfaces, adds this gem to venerable Iterator:
default void remove() {
throw new UnsupportedOperationException("remove");
} By default now when you implement an iterable you need not supply "remove()". Beautiful.
There is also a new, defaulted "forEachRemaining(Consumer)".
No comments:
Post a Comment