Interfaces are otherwise used pretty much just like classes in Java. Simple one-method interfaces are often needed to standardize naming conventions. While not predefined, other canonical forms also have commonly adopted names. But in Java, each subinterface must be explicitly listed as extend ing one or more other interfaces, implicitly inheriting all of the super-interface operations. Actually implementing the methods defined in the interface.
Subclasses can also implement unrelated interfaces.
Abstract classes form an interesting and useful middle ground between interfaces and classes. Abstract classes are different than ordinary classes in that they declare one or more interface-style abstract methods in addition to normal methods and instance variables. Such classes must be explicitly declared as abstract . But the declaration of canConnectTo is abstract since it has to be implemented differently in every public subclass. Every MachinePart subclass gets its partID mechanics for free, but must specially implement canConnectTo .