Rectangle class

Suppose you are given a class named Rectangle with the following contents:

// A Rectangle stores an (x, y) coordinate of its top/left corner, a width and height.
public class Rectangle {
    private int x;
    private int y;
    private int width;
    private int height;

    // constructs a new Rectangle with the given x,y, width, and height
    public Rectangle(int x, int y, int w, int h)

    // returns the fields' values
    public int getX()
    public int getY()
    public int getWidth()
    public int getHeight()

    // returns a string such as {(5,12), 4x8}
    public String toString()

    ...
}