Objects with the same structure and behavior are grouped into classes. A class defines:
class Point { public int x, y; /* default constructor */ public Point() { x = 0; y = 0; } public Point(int x, int y) { this.x = x; this.y = y; } } class Rectangle { public Point origin, corner; public int Width() { return corner.x - origin.x; } public int Height() { return corner.y - origin.y; public int Circumference() { return 2 * (Width() + Height()); } public int Surface() { return Width() * Height(); } }