Skip to content
Advertisement

Tag: jsr335

Why is “final” not allowed in Java 8 interface methods?

One of the most useful features of Java 8 are the new default methods on interfaces. There are essentially two reasons (there may be others) why they have been introduced: Providing actual default implementations. Example: Iterator.remove() Allowing for JDK API evolution. Example: Iterable.forEach() From an API designer’s perspective, I would have liked to be able to use other modifiers on

Advertisement