class Rectangle implements Shape { 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; } public void setPosition(double xpos, double ypos){ x = xpos; y = ypos; } public void printDetails(){ System.out.println("Rectangle: pos = ("+x+", "+y+"), area = "+area()); } }