Unformatted text preview: private – members CAN ONLY access. • protected – CAN be accessed from ‘same package’ and a subclass existing in any package can access. Access Control Modifiers: Java provides a number of access modifiers to set access levels for classes, variables, methods and constructors. The four access levels are: 1. Visible to the package. the default. No modifiers are needed. 2. Visible to the class only (private). 3. Visible to the world (public). 4. Visible to the package and all subclasses (protected). Non Access Modifiers: Java provides a number of non-access modifiers to achieve many other functionality. • The static modifier for creating class methods and variables • The final modifier for finalizing the implementations of classes, methods, and variables. • The abstract modifier for creating abstract classes and methods. • The synchronized and volatile modifiers, which are used for threads....
View Full Document
- Spring '11
- Grammatical modifier, Access Modifiers