java编译提示错误信息_JAVA编译错误提示缺少“{”
展開全部
有點(diǎn)粗心了 我把我修改過的發(fā)62616964757a686964616fe58685e5aeb931333335323435給你
具體問題:是extends不是extands
類Circle拼錯
Circle構(gòu)造方法height拼錯abstract?class?Shape
{
public?int?width,height;
public?Shape(int?width,int?height)
{
this.width=width;
this.height=height;
}
abstract?double?getArea();
}
class?Rectangle?extends?Shape
{
public?double?getArea()
{
return?width*height;
}
public?Rectangle(int?width,int?height)
{
super(width,height);
}
}
class?Circle?extends?Shape
{
double?r;
public?double?getArea()
{
return?r*r*Math.PI;
}
public?Circle(int?width,int?height)
{
super(width,height);
r=(double)width/2.0;
}
}
public?class?JavaApplication4
{
public?static?void?main(String[]?args)
{
Rectangle?re=new?Rectangle(25,25);
Circle?ci=new?Circle(8,4);
System.out.println(re.getArea()+ci.getArea());
}
}
總結(jié)
以上是生活随笔為你收集整理的java编译提示错误信息_JAVA编译错误提示缺少“{”的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java 内存快照怎么看_jvm内存快照
- 下一篇: java 继承 实现 会重写 方法吗_j