rectangle.java
来自「java教程中的编程实例」· Java 代码 · 共 21 行
JAVA
21 行
public class Rectangle extends Shape{
double length;
double wide;
public Rectangle(double x,double y){
length = x ;
wide = y ;
}
public double area(){
double s;
s=length*wide;
return s;
}
public double perimeter(){
double p;
p=(length+wide)*2.0;
return p;
}
public String getabout(){
return "this is Rectangle length is:"+length+"wide is+"+wide;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?