What are access modifiers in java?

The important feature of encapsulation is access control. By preventing access control we can misuse of class, methods and members.

A class, method or variable can be accessed is determined by the access modifier.

There are three types of access modifiers in java. public, private, protected.

If no access modifier is specified then it has a default access.


Posted

in

Tags:

Comments

Leave a Reply