Intuitively, every square is a rectangle, so it is tempting to use inheritance for implementing a square:
public class Square extends Rectangle
However, the devil is in the details. The Square class inherits all mutators of Rectangle, and some of them can mutate a square into a non-square shape.
The safer approach is to use aggregation:
public class Square { . . . private Rectangle rect; }
Now we do not inherit any Rectangle methods. Instead, all methods must be implemented so that they operate on the rect instance field. Your task is to implement the constructor and three methods.