Why doesn’t Java allow private members in interface?

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.

Leave a Comment