Java Reference
In-Depth Information
At run time, interface fields that are initialized with constant expressions (§ 15.28 ) are ini-
tialized first (§ 12.4.2 ). This also applies to static final fields in classes (§ 8.3.2.1 ). These fields
are “constants” that will never be observed to have their default initial values (§ 4.12.5 ) ,
even by devious programs (§ 13.4.9 ) .
9.4. Abstract Method Declarations
AbstractMethodDeclaration:
AbstractMethodModifiers opt TypeParameters opt Result
MethodDeclarator Throws opt ;
AbstractMethodModifiers:
AbstractMethodModifier
AbstractMethodModifiers AbstractMethodModifier
AbstractMethodModifier: one of
Annotation public abstract
If an annotation a 9.7 ) on a method declaration corresponds to an annotation type T
9.6 ) , and T has a (meta-)annotation m that corresponds to java.lang.annotation.Target , then m
must have an element whose value is java.lang.annotation.ElementType.METHOD , or a compile-
time error occurs.
Every method declaration in the body of an interface is implicitly public 6.6 ) .
Every method declaration in the body of an interface is implicitly abstract , so its body is al-
ways represented by a semicolon, not a block.
It is permitted, but discouraged as a matter of style, to redundantly specify the public and/or
abstract modifier for a method declared in an interface.
It is a compile-time error if the same modifier appears more than once on a method declared
in an interface.
It is a compile-time error if a method declared in an interface is declared static , because static
methods cannot be abstract .
It is a compile-time error if a method declared in an interface is strictfp or native or synchron-
ized , because those keywords describe implementation properties rather than interface prop-
erties.
However, a method declared in an interface may be implemented by a method that is de-
clared strictfp or native or synchronized in a class that implements the interface.
Search WWH ::




Custom Search