【正确答案】public class Rectangle {
float width, height;
public Rectangle(float width, float height) {
this.width = width;
this.height = height;
}
public float getLength______{
return (this.width + this.height) * 2;
}
public float getArea______{
return this.width * this.height;
}
public static void main(String [] args) {
Rectangle rect = new Rectangle(10, 20);
System.out.println("周长是:" + rect.getLength______);
System.out.println("面积是:" + rect.getArea______);
}
}
【答案解析】