public class Rectangle { private int width; private int height; public Rectangle(int width, int height) { width = width; this.height = height; }
public int computeArea() {
return this.width * this.height;
}
private void test1() {1Rectangle rec = new Rectangle(10, 5);2int a = rec.computeArea();3if (a == 50) prn("PASSED"); else prn("FAILED"); prn("Rectangle: " + rec); prn("Area: " + rec.computeArea()); }
public Rectangle(int width, int height) { width = width; this.height = height; }
public Rectangle(int width, int height) { this.width = width; this.height = width; }
public Rectangle(int width, int height) {
this.width = width;
}
public int computeArea() { return this.width + this.height; }