CS 18000 Lecture 9: Interfaces
Document Summary
Typically asymmetric: one system defines the interface, the other system. Graphical user interface (gui): user -> computer. Application programming interface (api): application program -> library of related methods. Java class: a java class provides one form of interface, public members (methods, mainly) define the interface to clients (users) of that class, class interface consists of. Public method signatures (what the method expects) Method return types (what the method returns: the java language abstracts this idea one step further . A class that defines the interface, and. A class that implements (uses) the interface: any class that implements the interface must provide implementations for all the method bodies given in the interface definition (except default methods) No fields (other than constants: an interface is like a class in which you forgot to declare the fields and left out the method bodies.