Why doesn't Java allow private members in interface?
Why doesn't Java allow private members in interface? Is there any particular reason?
From the Java Language Spec, (Access Control):
"The Java programming language provides mechanisms for access control, to prevent the users of a package or class from depending on unnecessary details of the implementation of that package or class."
Access control is all about hiding implementation details. An interface has no implementation to hide.
In Java 9, private methods in interfaces are possible.
Java 9 specifications
The javac compiler team is pleased announce the availability of compiler support for private methods in interfaces beginning with 9 b54 build of JDK.
Private interface methods are part of Java 9 as part of JEP-213. Since interfaces in Java 8 can have default methods, private methods allow for multiple default methods to use a shared private method.