private members can be accessed only by code in the same class. : private « Modifiers « SCJP






private methods/constructors, field variables, inner classes 
may only be accessed within the class in which it is declared.

private members are not visible to subclasses, so private members cannot be inherited.

There is no protected or private top-level class.

protected class MainClass{ //Error
    public static void main(String[] argv){
       System.out.println();
    }
}
    
private class MainClass{ //Error
    public static void main(String[] argv){
       System.out.println();
    }
}








3.2.private
3.2.1.private members can be accessed only by code in the same class.
3.2.2.A private variable or method may be used only by an instance of the class.
3.2.3.An instance of a subclass is denied access for private features