?? 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 + -