There are four access modifiers in Java:
1. public - A class, method, or field that is declared public can be accessed from any other class, regardless of the package in which it is defined.
2. protected - A class, method, or field that is declared protected can be accessed