Three access modifiers: public, protected, and private. Four access levels: public, protected, default, and private. : Access Modifiers « Modifiers « SCJP






Default accessor occurs when public, protected, or private are not specified. 

Classes can have only public or default access.

Classes can also be modified with final, abstract, or strictfp.

If a class cannot be accessed, its members cannot be accessed.

public class MainClass{
    public static void main(String[] argv){
       System.out.println();
    }
}
class MyClass{
  private i = 0;
}








3.1.Access Modifiers
3.1.1.Three access modifiers: public, protected, and private. Four access levels: public, protected, default, and private.
3.1.2.You can have at most one access modifier.
3.1.3.Can access modifiers be applied to local variables? NO!
3.1.4.All Possible Combinations of Features and Modifiers
3.1.5.Determining Access to Class Members
3.1.6.The order in which modifiers appear in a declaration is not important.