📄 chap4-10.txt
字号:
// 程序4-10
class point{
int x, y;
point( ){ this(0,0);}
point(int x, int y){ this.x=x; this.y=y; }
double area( ){ return 0;} // 注意父类中的这个方法
}
class circle extends point{
int radius;
circle(int r, int x, int y){ super(x, y); radius=r; }
double area(double pi){ // 方法特征与父类中的不同
return pi*radius*radius ;
}
}
public class testOverWrite {
public static void main(String args[ ]) {
circle c1;
c1=new circle(1,1,1);
System.out.println(c1.area( ));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -