Access Modifiers in Java


Understand how access modifiers (public, private) control access levels in Java.

Source Code

public class MyClass {
    private int x = 10;
    public int getX() {
        return x;
    }
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments