我已经声明了枚举函数如下
public static enum SHAPE
{
static
{
LINE = new SHAPE("LINE", 3);
CIRCLE = new SHAPE("CIRCLE", 4);
TEXT = new SHAPE("TEXT", 5);
SHAPE[] arrayOfSHAPE = new SHAPE[6];
arrayOfSHAPE[0] = DRAW;
arrayOfSHAPE[1] = SQUARE;
arrayOfSHAPE[2] = TRIANGLE;
arrayOfSHAPE[3] = LINE;
arrayOfSHAPE[4] = CIRCLE;
arrayOfSHAPE[5] = TEXT;
}
}
但我得到
Syntax error, insert "}" to complete Block at line4 and getting Syntax error, insert "EnumBody" to complete EnumDeclaration at line1.
所以请协助我宣布这个枚举。提前致谢。