What is an interface class?
-
A collection of method declarations and constant values
-
An abstract base class
-
A way to get multiple inheritance
-
A way to inherit variables and method implementations
An interface in Java is a collection of abstract method declarations and constant values. It defines a contract without implementation - classes implement interfaces to provide specific behavior while achieving a form of multiple inheritance of type.
An interface in Java is essentially a contract: it consists of method signatures (declarations without bodies) and constant (static final) field values, with no implementation of its own. It is not itself an abstract base class, though it's one mechanism Java uses to approximate multiple inheritance of type — but that's a use of interfaces, not their definition.