How to: What is the reason why “synchronized” is not allowed in Java 8 int erface methods?
How to: What is the reason why “synchronized” is not allowed in Java 8 int erface methods?
What is the reason why “synchronized” is not allowed in Java 8 interface methods?
In Java 8, I can easily write:
interface Interface1 { default void method1() { synchronized (this) { // Something } } static void method2() { synchronized (Interface1.class) { // Something } } }
I will get the full synchronisation semantics that I can use also in classes. I cannot, however, use the synchronizedmod…
View On WordPress













