Παράδειγμα εσωτερικής κλάσής

class Rectangle {
    private static class Point {
        private int x, y;

        /** Point constructor */
        Point(int ix, int iy) {
            x = ix;
            y = iy;
        }
    }

    private Point topLeft, bottomRight;

    /** Rectangle constructor */
    Rectangle(int x, int y, int height, int width) {
        topLeft = new Point(x, y);
        bottomRight = new Point(x + width, y + height);
    }
}