Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Public instance attributes

public class TryPoint {
    public static void main(String[] args) {
        Point a = new Point(2, 3);
        System.out.println(a);
        System.out.println(a.x);
        a.x = 7;
        System.out.println(a.x);
        //System.out.println(a.getX);
    }
}
public class Point {
    public int x;
    private int y;
    public Point(int x, int y) {
        this.x = x;
        this.y = y;
    }
}