Access to class members of all types is controlled by access modifier keywords and the no-keyword default as follows:
public— A public member is accessible from any class in the program.
protected— A protected member can be accessed only by classes in the same package and classes derived from the current class—no matter which package they are in.
private— A private member can be accessed only from within the class.
default— If none of the other access modifier keywords appear, the default applies (access only by classes in the same package). You may see the word “friendly” used in connection with the default access, but “friendly” is not a Java keyword.
Other keywords that can be applied to class members are static, final, abstract ...