From the Java Language Specification, 8.2:
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)
The important part about inheritance, regarding private
, public
and protected
members:
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 declared 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.