gpt4 book ai didi

java - 语法错误,插入 "Identifier"以完成 Enum Constant Header

转载 作者:行者123 更新时间:2023-11-29 07:16:25 25 4
gpt4 key购买 nike

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;
}

这里我得到语法错误 insert "Identifier"to complete Enum Constant Header 。如何纠正这个....

}

最佳答案

这不是您声明枚举的方式。你通常会:

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

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

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

关于java - 语法错误,插入 "Identifier"以完成 Enum Constant Header,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9272989/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com