Answer:
An Access Modifier is a key word in java that determines what level of access or visibility a particular java variable/method or class has. There are 4 basic access modifiers in java. They are:
1. Public
2. Protected
3. Default and
4. Private
Java does not have a friendly access modifier.
Public Members:
If a variable or method is declared public, it means that it can be accessed by anyone or any other class (irrespective of which package they are in).
Private Members:
Members marked private can't be accessed by code in any class other than the class in which the private member was declared
Protected and Default Members:
The protected and default access control levels are almost identical, but with one critical difference. A default member may be accessed only if the class accessing the member belongs to the same package, whereas a protected member can be accessed (through inheritance) by a subclass even if the subclass is in a different package