JavaInterface
JavaInterface
) is like a contract or a
blueprint.
It only defines what methods or properties a class should have, but not how they
work.
It has method declarations, not method bodies.
A class that "implements" the interface must provide the body (implementation) for
all those methods.
Nested interfaces (interfaces declared inside a class or another interface) can be:
o public
o protected
o private
o default (package-private)
Methods are Implicitly public.
They must be public, as interface methods cannot have less visibility than the
interface itself an implementation).
default methods allow classes to inherit a method implementation
When an interface extends another, it inherits all the abstract methods of the parent
interface, and any class implementing the child interface must provide an
implementation for those methods.