myrectangle.java
来自「java课程的资料以及实验的代码」· Java 代码 · 共 19 行
JAVA
19 行
class MyRectangle implements Area
{
double width;
double height;
MyRectangle(double width,double height)
{
this.width=width;
this.height=height;
}
public double calculateArea()
{
return width*height;
}
public static void main(String args[])
{
MyRectangle rect=new MyRectangle(50,60);
System.out.println("The Area of rectangle is:"+rect.calculateArea());
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?