class Rectangle {
private int width;
private int high;
public Rectangle(){}
public Rectangle(int width,int high){
this.width = width;
this.high = high;
}
public void setWidth(){
this.width = width;
}
public int getWidth(int width){
return width;
}
public void setHigh(){
this.high = high;
}
public int getHigh(int high){
return high;
}
public int getLength(){
return 2*(width+high);
}
public int getArea(){
return width*high;
}
}
class Test3_Rectangle {
public static void main(String[] args) {
Rectangle re = new Rectangle();
re.setWidth(30);
re.setHigh(40);
System.out.println("周长为"+re.getLength()+" "+"面积为"+re.getArea());
}
}