An interface declaration consists of the interface keyword and interface name . The declaration can also optionally include modifiers and can indicate if the interface extends (inherits from) a superinterface. [modifiers] interface interface_name [extends superinterface(s)] { // method declarations // constant declarations } The body of the interface, usually consisting of method and constant declarations, is surrounded by braces. Interfaces can have public or default access. A public interface is available to any other code. An interface with default (unspecified) access is only available to other members of the package in which it is declared. Only one public interface can exist in a given file. Example: Declaring InterfacesSee the example in the "Interface Members" section where the Electrostatic interface is declared. |