📄 shape.java
字号:
/**
*Title:Shape.java
*Descrption: This abstract class define the general shape.
*@author: Peng yu
*@version:1.0
*/
public abstract class Shape
{
protected int height;
protected int width;
protected int base; //define three variables
public abstract double calcShapeArea(); //abstract method to calculate the area
public abstract double calcShapePerimeter(); //abstract method to calculate the perimeter
/**
* This method simply gets the height of the shape
* @return the height of the shape
*/
public int getHeight()
{
return this.height;
}
/**
* This method simply gets the width of the shape
* @return the width of the shape
*/
public int getWidth()
{
return this.width;
}
/**
* This method simply gets the base of the shape
* @return the base of the shape
*/
public int getBase()
{
return this.base;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -