![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
求助一道简单的JAVA编程题 10
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();
}
大概写了下 参考一下吧
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();
}
大概写了下 参考一下吧
![](https://ecmc.bdimg.com/public03/b4cb859ca634443212c22993b0c87088.png)
2024-08-21 广告
MarsCode 为你提供了编程助手和 IDE 来协助你完成编程任务。 MarsCode 编程助手提供以智能代码补全为代表的 AI 功能。它支持主流的编程语言和 IDE,在开发过程中提供单行代码或整个函数的编写建议。此外,它还支持代码解释、...
点击进入详情页
本回答由MarsCode提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询