你没有创建Class B
怎么会有构造方法public B()以及怎么new B???
2.定义类没有public???
public class Circle{
private double r;
public Circle(double r){
this.r = r;
}
public double getZhou(){
return 2*Math.PI*r;
}
public double getArea(){
return Math.PI*r*r;
}
public void setR(double r){
this.r = r;
}
public int getR(){
return r;
}
}
public class Cylinder extends Circle{
private double h;
public Cylinder(double r, double h){
super(r);
this.h = h;
}
public double getFaceArea(){
getZhou() * h;
}
public double getVolumn(){
getArea() * h;
}
public void setH(double h){
this.h = h;
}
public int getH(){
return h;
}
}
classA
{
intx;
publicA(intx)
{ this.x=x; }
}
public B()//创建类却没有class关键字{}
}