| |
3.1.1.Three access modifiers: public, protected, and private. Four access levels: public, protected, default, and private. |
|
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;
}
|
|
|