如图java题,求大神啊!!!
public class Rect {
private double pointX;
private double pointY;
private double width;
private double height;
// 构造函数
public Rect(double pointX, double pointY, double width, double height) {
this.pointX = pointX;
this.pointY = pointY;
this.width = width;
this.height = height;
}
// 计算面积
public double calculateArea(int width, int height) {
return width * height;
}
// 获取x坐标
public double getPointX() {
return pointX;
}
// 获取y坐标
public double getPointY() {
return pointY;
}
// 获取宽度
public double getWidth() {
return width;
}
// 获取高度
public double getHeight() {
return height;
}
}