public enum AnnotationType
{

  static
  {
    AnnotationType[] arrayOfAnnotationType = new AnnotationType[9];
    AnnotationType CIRCLE;
    arrayOfAnnotationType[0] = CIRCLE;
    AnnotationType FREETEXT;
    arrayOfAnnotationType[1] = FREETEXT;
    AnnotationType HIGHLIGHT;
    arrayOfAnnotationType[2] = HIGHLIGHT;
    AnnotationType INK;
    arrayOfAnnotationType[3] = INK;
    AnnotationType LINE;
    arrayOfAnnotationType[4] = LINE;
    AnnotationType NOTE;
    arrayOfAnnotationType[5] = NOTE;
    AnnotationType SQUARE;
    arrayOfAnnotationType[6] = SQUARE;
    AnnotationType STRIKETHROUGH;
    arrayOfAnnotationType[7] = STRIKETHROUGH;
    AnnotationType UNDERLINE;
    arrayOfAnnotationType[8] = UNDERLINE;
    AnnotationType[] ENUM$VALUES = arrayOfAnnotationType;
  }


在这里,我得到了语法错误插入“标识符”,以完成枚举常量头。如何更正此问题。

}

最佳答案

那不是您声明枚举的方式。您通常有:

public enum AnnotationType
{
     CIRCLE, FREETEXT, HIGHLIGHT, INK, LINE, NOTE, SQUARE,
     STRIKETHROUGH, UNDERLINE;
}


...尽管您可以创建自己的构造函数并将数据传递给它,等等。

看来您基本上是在尝试重新编译反编译器的输出。为什么需要这样做?

10-06 07:00