Java Default Access Modifier. These classes and objects are contained in a package. An access modifier restricts the access of a class, constructor, data member and method in another class.

There are four types of access modifiers in java, private, protected, public, and default. Consider the following two classes: A constructor calls the default constructor of its superclass: