0
好,那麼子類的每個實例,也就是擴展了Tetrimino的J_Tetrimino類,都會得到它自己的int [] [] UP和String方向?父級抽象類中的變量是否由子類繼承?
public abstract class Tetrimino {
// [row][col]
/*The size of the area a tetrimino needs*/
protected final int TETRIMINO_SPACE_SIZE = 3;
/*The upwards and initial orientation of the J tetrimino*/
protected int[][] UP;
/*The left and second orientation of the J tetrimino*/
protected int[][] LEFT;
/*The down and third orientation of the J tetrimino*/
protected int[][] DOWN;
/*The right and fourth orientation of the J tetrimino*/
protected int[][] RIGHT;
protected String orientation = "UP";
public String getCurrentOrientation() {
return orientation;
}
感謝這正是我想知道的! – 2014-08-29 03:20:38