我有以下代码:
/** Width of each brick in pixels */
private static final int BRICK_WIDTH = 11;
/** Width of each brick in pixels */
private static final int BRICK_HEIGHT = 12;
/** Number of bricks in the base of the pyramid */
private static final int BRICKS_IN_BASE = 14;
public void run () {
int LowerLeftSide;
if (BRICK_WIDTH / 2 == 0)
{
LowerLeftSide = ((getWidth()/2) - (BRICK_WIDTH*(BRICKS_IN_BASE/2)));
}else
LowerLeftSide = ((getWidth()/2) - (BRICK_WIDTH*(BRICKS_IN_BASE/2-1)));
eclipse 将整个标记if
为死代码。我在 run 方法的最开始初始化值。
谢谢。