What is the reason why “synchronized” is not allowed in Java 8 interface methods?

While at first it might seem obvious that one would want to support the synchronized modifier on default methods, it turns out that doing so would be dangerous, and so was prohibited. Synchronized methods are a shorthand for a method which behaves as if the entire body is enclosed in a synchronized block whose lock … Read more

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

This question is, to some degree, related to What is the reason why “synchronized” is not allowed in Java 8 interface methods? The key thing to understand about default methods is that the primary design goal is interface evolution, not “turn interfaces into (mediocre) traits”. While there’s some overlap between the two, and we tried … Read more