What is the keyword used to define an interface in Java?

The story behind the answer

The keyword used to define an interface in Java is interface.

It appears in declarations such as public interface Comparable<T> and introduces a reference type that describes a contract of behavior. A class uses implements to promise that it supplies the interface’s required behavior, while an interface uses extends to inherit from one or more other interfaces.

Interfaces were part of Java from its earliest releases and helped Java support multiple behavioral contracts without allowing multiple inheritance of classes. A class can implement several interfaces, making interface types useful for polymorphism and loosely coupled program design.

Originally, interface methods were primarily abstract declarations and fields were constants. Java 8 added default and static methods with implementations, and Java 9 added private interface methods. The interface type itself remains abstract: it cannot normally be instantiated directly, even though references can point to objects of implementing classes.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: