[code="java"]
public class Shape {//图形类
public double area(){
return 0;
}
}
[/code]
[code="java"]
public class Circle extends Shape{//圆类继承图形类
public int r;
public Circle(int r){
this.r=r;
}
public double area(){
return Math.PI*r*r;
}
}
[/code]
[code="java"]
public class CircleDemo {//测试程序
public static void main(String []args){
System.out.print("圆的面积="new Circle(4));
}
}
[/code]
出现的结果是 圆的面积=day09.Circle@1fc4bec
求解决!