Java Access Modifiers

The access modifiers in java specify accessibility (scope) of a data member, method, constructor or class.

There are 4 types of java access modifiers:


1. The private access modifier is accessible only within the class.
2. The default modifier is accessible only within the package.
3. The protected access modifier is accessible within the package and outside the package but through inheritance only.
4. The public access modifier is accessible everywhere. It has the widest scope among all other modifiers.

Please email us at if you need any further information.