Because an interface is supposed to mean “what you can see from outside the class”. It would not make sense to add non-public methods.
More Related Contents:
- Attempt to invoke interface method ‘int java.util.List.size()’ on a null object How Solve It? [duplicate]
- Why should the interface for a Java class be preferred?
- Abstract class in Java
- Java – Method name collision in interface implementation
- Why is there no multiple inheritance in Java, but implementing multiple interfaces is allowed?
- What is an interface in Java?
- Explicitly calling a default method in Java
- Why to use Interfaces, Multiple Inheritance vs Interfaces, Benefits of Interfaces?
- Why java classes do not inherit annotations from implemented interfaces?
- When to use abstract class or interface? [closed]
- How to create interface between Fragment and adapter?
- The difference between the Runnable and Callable interfaces in Java
- How to implement enum with generics?
- Can we create an instance of an interface in Java? [duplicate]
- Interface naming in Java [closed]
- What does it mean to program to an interface?
- How to use interface to communicate between two activities
- Why does it compile when casting to an unrelated interface? [duplicate]
- not implementing all of the methods of interface. is it possible?
- Java getting an error for implementing interface method with weaker access
- Why are all fields in an interface implicitly static and final?
- How to write junit tests for interfaces?
- Optional Methods in Java Interface
- Implementing two interfaces with two default methods of the same signature in Java 8
- Final arguments in interface methods – what’s the point?
- Passing function as a parameter in java
- Meaning of “Cannot reduce the visibility of the inherited method” with an interface
- Java Interface Usage Guidelines — Are getters and setters in an interface bad?
- Attributes / member variables in interfaces?
- How to reference a generic return type with multiple bounds