Class Member Access Protection and Package

The following table shows the access matrix for Java.

Position and Access

PositionPrivateNo modifierProtectedPublic
Same classYesYesYesYes
Same package subclassNoYesYesYes
Same package non-subclassNoYesYesYes
Different package subclassNoNoYesYes
Different package non-subclassNoNoNoYes
java2s.com  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.