|
Java Reference Home | Smart Soft Home |
|
|
private
The keyword private has two uses: as a variable modifier and as a method modifier. Description #1 - Variable ModifierIndicates the visibility of a variable. A private visibility can only be accessed by methods in the same class.Example #1 - Variable Modifierprivate int x; Description #2 - Method ModifierIndicates the visibility of a method. A private method can only be invoked by other methods in the same class.Example #2 - Method Modifier
private void calc(){
..
..
}
|
|