Difference between public, private, protected and default in Java
Difference between public, private, protected and default in Java
For access control, Java provides four access modifiers private, public, protected, and default. The main difference between all these access modifiers can be viewed when we compare the visibility or accessibility scope of a class and its members defined with these modifiers . An access modifier defines how a class and its members can access, and basically, controls accessibility. It determines…
View On WordPress













