public class Rectangle { double x, y; // position double w, h; // width and height Rectangle(double width, double height){ x = 0; y = 0; w = width; h = height; } double area(){ return w*h; } void setPosition(double xpos, double ypos){ x = xpos; y = ypos; } void printDetails(){ System.out.println("pos = ("+x+", "+y+"), area = "+area()); } }