Access Specifiers and Modifiers
Classes enable an object to access data variables or methods of another class. Java provides access specifiers and modifiers to decide which part of the class, such as data members and methods will be accessible to other classes or objects and how the data members are used in other classes and objects.
An access specifier controls the access of class members and variable by other objects. The variouse types of access specifiers in Java are: