Packages are part of Java's access control mechanism. A member with protected access is accessible to all members of the same package. Outside of the package in which it is defined, a protected member is only accessible to subclasses of the class in which it is defined. A member with default access is accessible to all members in the same package but is not accessible outside of the package. |