Interfaces

Interfaces

Interfaces follows a similar style to classes. An interface declaration looks like the following. Elements in square brackets [] are optional.

 [public] interface InterfaceName [extends SuperInterfaces] {            InterfaceBody } 

SuperInterfaces is the name of an interface, or a comma-separated list of interfaces. If more than one interface is given, then they should be sorted in lexical order.

An interface declaration always starts in column 1. All of the above elements of the interface declaration up to and include the opening brace { should appear on a single line (unless it is necessary to break it up into continuation lines if it exceeds the allowable line length). The InterfaceBody is indented by the standard indentation of four spaces. The closing brace } appears on its own line in column 1. There should not be a semicolon following the closing brace .

All interfaces are inherently abstract; do not explicitly include this keyword in the declaration of an interface.

All interface methods are inherently abstract; do not explicitly include this keyword in the declaration of an interface method.



Software Development. Building Reliable Systems
Software Development: Building Reliable Systems
ISBN: 0130812463
EAN: 2147483647
Year: 1998
Pages: 193
Authors: Marc Hamilton

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net