What are access modifiers in JAVA?Java provides four access modifiers
Public – The member with public modifier can be access by any other class. Protected – The member with protected modifier can be accessed by the derived class only. Private – The member with Private modifier can be accessed within the class. Default – Default represents Private access in JAVA.
|