Write a program to Access Modifier in Java.

 

Output: