继承不明白 求解
java初学者,刚学到学到继承,编译时结果又一条读不懂,求解释。代码:
package xx;
class Shape{
void area(){
}
void perimeter(){
}
}
class Circle extends Shape{
Circle(double r){
area(r);
perimeter(r);
}
void area(double r){
System.out.println(r*r*3.14f);
}
void perimeter(double r){
System.out.println(2*r*3.14f);
}
}
public class TextJieKou {
public static void main(String[] args) {
// TODO Auto-generated method stub
Circle a=new Circle(5.4);
System.out.print(a);
}
}
结果:91.56240305900575
33.91200113296509
xx.Circle@6d084b//就是这一条不知道怎么回事