import java.awt.Rectangle;
import java.util.*;
public class ww {public static void main(String[]agrs) {
Disk d1=new Disk();
d1.setWidth(9.48);
Disk d2=new Disk();
d2.setLength(4.2);
System.out.println("area="+d1.getArea());
}
}
class Disk {
public double width;
public double length;
public void setWidth(double w) {
width=w;
}
public void setLength(double len) {
length=len;
}
public double getWidth() {
return width;
}
public double getlength() {
return length;
}
public double getArea() {
return width*length;
}
public String tostring() {
return "area="+getArea();
}
//不知道为什么我运行后,面积的答案是area=0.0,很明显不对啊,9.48*4.2不可能是0.00啊 我是哪里写错了吗?很困惑
___C___
___C___
半枯