rectangles and square constructors

i have another problem with constructors. here is the problem:

Complete the class, named Rectangle, that creates a new rectangle, given the integer height (h) and width (w) of the rectangle. This means that the constructor has two parameters.

Recall that a square is a special case of a rectangle, with its height equal to its width. Hence, a square can be constructed as a Rectangle, with only a single parameter. This is a case of overloading the constructor, by having two constructor methods, each with different parameters than the other.

Besides the constructors, this class should include a method named perimeter, to compute the perimeter of the rectangle (2 x width + 2 x height), as well as a method named area to compute the area of the rectangle (width x height).

I wasn't sure what they meant by "constructs".

here is my code:

Code:

`/**`

A rectangle with height and width.

*/

public class test

{

private int height;

private int width;

/**

Constructs a rectangle.

@param aHeight: the height of the rectangle

@param aWidth: the width of the rectangle

*/

public void Rectangle(int aHeight, int aWidth)

{

int perimeter = (2*aWidth) + (2*aHeight);

}

/**

Constructs a rectangle that is a square.

@param aSide: the length of a side of the square

*/

public void Rectangle(int aSide)

{

int area;

area = aSide*aSide;

}

/**

Computes the perimeter.

@return the perimeter of the rectangle

*/

public int perimeter()

{

return perimeter;

}

/**

Computes the area.

@return the area of the rectangle

*/

public int area()

{

return area;

}

}

and the code they will use to check it:

Code:

`public static String check(int h, int w, int sideSq)`

{

Rectangle aRect = new Rectangle(h, w);

Rectangle aSquare = new Rectangle(sideSq);

return aRect.perimeter() + " " + aRect.area() + " "

+ aSquare.perimeter() + " " + aSquare.area();

}

}