Why `private static` field is not allowed in Java 8 interface?
问题 When I'm trying to compile the following code public interface SomeInterface{ private static Logger logger = Logger.getLogger(); public default void someMethod(){ logger.info("someMethod: default implementation"); } } I get an error Illegal modifier for the interface field SomeInterface.logger; only public, static & final are permitted When I delete private modifier, code compiles, but I don't want other classes from the package to see this field. Why Java doesn't allow me to do such thing