There are four
access levels available in Java:
public,
protected,
private, and package-private. Package-private isn’t explicitly declared using a keyword. Instead, it’s the default access level for every member in Java.
public int myPublic; // unrestricted access
protected int myProtected;// package or subclass access
int myPackage; // package access
private int myPrivate; // class access
Private Access
All members, regardless of access level, are accessible in the class in which they are declared—the containing class. This is the only place where a private member ...