Java Access Modifier.

In Java, access modifier is used to set the access level for classes, attributes, methods and constructors.

Code :