1: /**
2: Class that represents a rectangle.
3: */
4: public class Rectangle
5: {
6: private int width;
7: private int height;
8: private int area;
9:
10: public void setDimensions(int newWidth, int newHeight)
11: {
12: width = newWidth;
13: height = newHeight;
14: area = width * height;
15: }
17: public int getArea()
18: {
19: return area;
20: }
21: }