Construction. Interfaces

[comp1110-3L]

An interface is a reference type in Java that specifies a set of method signatures but does not provide their implementations. It serves as a contract: any class that implements the interface promises to provide the logic for those methods.

An interface is typically open: any number of classes can implement it across different parts of a codebase.

You cannot create instances of interfaces directly, they must always be objects of a class implementing the interface.

bars magnifying-glass caret-down plus minus arrow-right xmark