Java Quick Reference
  Language Fundamentals
  Operators and Assignments
  Flow Control and Exceptions
  Declarations and Access Control
  Garbage Collection
  Overloading and Overriding
  Threads
  The java.lang Package
  The java.util Package
  The java.awt Package
  The java.io Package
  References
  Miscellaneous Notes
  Tips & Traps
  Mock Exams

Declarations and Access Control - Inheritance

Package members (JLS §6.4.1)

  • package members include all subpackages, and all top-level class and interface types declared in the package source files
  • subpackages are determined by the host system.
  • the java package always includes the subpackages lang and io and may include others
  • no two distinct members of a package may have the same simple name

Class and Interface members (JLS §6.4.2 & §6.4.3)

  • class members are fields, methods, classes or interfaces declared within the body of the class or inherited by the class
  • constructors are not members
  • a field or method can have the same simple name
  • a member class or interface can have the same name as a field or method
  • a class can have two different field variables with the same simple name if they are declared in different interfaces and are inherited but they can only be accessed using their fully-qualified names (compile-error: ambiguous results if simple names are used)
  • a class can have two or more methods with the same simple-name if their signatures are different (overloading)
  • a class may have a method with the same simple-name and signature as an inherited method. The original method is not inherited and the new member is said to implement it, if the original was abstract or override it

Array members (JLS §6.4.4)

  • the public final field length which contains the number of components in the array (may be zero or any positive number)
  • the public method clone which overrides the method clone in Object and throws no checked exceptions
  • all members inherited from class Object


Access Modifiers Special Modifiers this and super Scope Inheritance Access Control