?? geometricshape.java
字號:
import java.util.ArrayList;
/**
* A superclass to define Geometric Shape.
*
* @author Ruixiao Wu.
* @version 1.0 26/06/2006.
*/
public abstract class GeometricShape {
/**
* An abstract class to define the geometric shapes.
*/
/**
* An method to creat random parameter of geometric shapes.
*
* @param numOfRandom,maxRange.
*/
public ArrayList<Integer> randomNum(int numOfRandom, int maxRange) {
ArrayList<Integer> numList = new ArrayList<Integer>();
int j;
for (int i = 0; i < numOfRandom; ++i) {
j = (int) (Math.random() * maxRange + 1);
numList.add(j);
}
return numList;
}
/**
* An abstract method to caculate the shapes' area.
*/
abstract void calculateArea();
/**
* An abstract method to caculate the shapes' perimeter.
*/
abstract void calculatePerimeter();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -