一道简单的java编程题。

2024-11-09 02:57:15
推荐回答(3个)
回答1:

public class Abstractor Area{
public abstractor double area();
}
public class RoundArea{

public RoundArea(double ra){this.area=ra}
private double area;
public double area(){
//求圆的面积
}
}
public class RectArea {
private double width;
private double leng;
public RectArea(double width,double leng){this.width = width; this.leng=leng}
public double area(){
//求长方形的面积
}
}

class ImpleArea{

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
area=br.read();
width= br.read();
leng = br.read();
RoundArea ra = new RoundArea(area);
double area1 = ra.area();
RectArea ra2 = new RectArea(width,leng);
double area2 = ra2.area();
}

大概写了下 参考一下吧

回答2:

路过

回答3:

路过,打酱油