Class Member Access Protection and Package

The following table shows the access matrix for Java.

PositionPrivateNo modifierProtectedPublic
Same classYesYesYesYes
Same package subclassNoYesYesYes
Same package non-subclassNoYesYesYes
Different package subclassNoNoYesYes
Different package non-subclassNoNoNoYes
Home 
  Java Book 
    Class  

Access Control:
  1. Access Control
  2. Member Access and Inheritance
  3. Class Member Access Protection and Package
  4. Modifiers and Features