📄 cuboidtest.java
字号:
class rectangle{
double length,width;
public rectangle(double length,double width){
this.length=length;
this.width=width;
}
public double area(){
return length*width;
}
}
class cuboid extends rectangle{
double height;
public cuboid(double l,double w,double h){
super(l,w);
height=h;}
public double volume(){
return area()*height;
}
}
public class cuboidtest{
public static void main(String args[]){
cuboid a =new cuboid(10,10,10) ;
System.out.println(""+a.area());
System.out.println(""+a.volume());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -