class Rectangle { int x, y; //location int w, h; // width and height // Constructors Rectangle(){ x = 0; y = 0; w = 0; h = 0; } Rectangle(int width, int height){ x = 0; y = 0; w = width; h = height; } int area(){ //Note implicit object context with w and h return w*h; } void setPosition(int xpos, int ypos){ x = xpos; y = ypos; } public String toString(){ return "pos = ("+x+", "+y+"), area = "+area(); } void printDetails(){ //Note the implicit object context when area() is called. System.out.print("pos = ("+x+", "+y+"), area = "+area()); //Note the EXPLICIT object context with x, y and area(). //System.out.print("pos = ("+this.x+", "+this.y+"), area = "+this.area()); } }