The keywords public, protected, default, and private are called the access modifiers. These access modifiers determines the scope of the classes, interfaces, variables, methods, constructors, data members, and the setter methods.
If the access modifier is *public*,then it is accessible by all the classes.
If the access modifier is *protected*,then it is accessible by all the classes in the same package and within sub-classes in other packages(through inheritance).
If the access modifier is *default*,then it is accessible by all the classes in the same package.
If the access modifier is *private*,then it is accessible within the same class as it is declared.