Java Reference
In-Depth Information
ClassBody:
{ ClassBodyDeclarations opt }
ClassBodyDeclarations:
ClassBodyDeclaration
ClassBodyDeclarations ClassBodyDeclaration
ClassBodyDeclaration:
ClassMemberDeclaration
InstanceInitializer
StaticInitializer
ConstructorDeclaration
ClassMemberDeclaration:
FieldDeclaration
MethodDeclaration
ClassDeclaration
InterfaceDeclaration
;
The scope and shadowing of a declaration of a member m declared in or inherited by a class
type C is specified in § 6.3 and § 6.4 .
If C itself is a nested class, there may be definitions of the same kind (variable, meth-
od, or type) and name as m in enclosing scopes. (The scopes may be blocks, classes,
or packages.) In all such cases, the member m declared in or inherited by C shadows
6.4.1 ) the other definitions of the same kind and name.
8.2. Class Members
The members of a class type are all of the following:
• Members inherited from its direct superclass (§ 8.1.4 ) , except in class Object , which
has no direct superclass
• Members inherited from any direct superinterfaces (§ 8.1.5 )
• Members declared in the body of the class (§ 8.1.6 )
Members of a class that are declared private are not inherited by subclasses of that class.
Only members of a class that are declared protected or public are inherited by subclasses de-
clared in a package other than the one in which the class is declared.
Constructors, static initializers, and instance initializers are not members and therefore are
not inherited.
Search WWH ::




Custom Search