public class Rectangle
{
private double width, height;
public Rectangle()
{
// initialise instance variables
width = 1;
height = 1;
}
public Rectangle(double w, double h)
{
// initialise instance variables
width = w;
height = h;
}
public double getArea()
{
// put your code here
return width*height;
}
public void setWidth(double w)
{
width = w;
}
public void setHeight(double h)
{
height = h;
}
}
|