Controlling Access with public, private and protected access modifiers. These access specifiers can be used on both variables/attributes and methods.…