| Modifier |
Used with |
Description |
| public |
Classes
Interfaces
Constructors
Inner Classes
Methods
Field variables
|
A Class or Interface may be accessed from outside its package.
Constructors, Inner Classes, Methods and Field variables may be accessed from wherever their class is accessed.
|
| protected |
Constructors
Inner Classes
Methods
Field variables
|
May be accessed by other classes in the same package or from any subclasses of the class in which they are declared. |
| private |
Constructors
Inner Classes
Methods
Field variables
|
May be accessed only from within the class in which they are declared. |
| no modifier |
Classes
Interfaces
Constructors
Inner Classes
Methods
Field variables
|
May only be accessed from within the package in which they are declared. |