5. What about java access modifiers?
Answer:
Java has access specifiers are public, private, protected. These can be placed infront of each definition for each member in your class, whether it's a data member or a method. Each access specifier controls the access for only that particular definition. This is a distinct contrast to C++, in which the access specifier controls all the definitions following it until another access specifier comes along.
Java access Modifiers.
- l public
- l private
- l protected
Note: These controls access to a class, a method, and member variable or an instance variable.
|