62,615
社区成员
发帖
与我相关
我的任务
分享
public enum Test{
A("A", 1), B("B", 2);
private String name;
private int index;
private Test(String name, int index) {
this.name = name;
this.index = index;
}
这个官网说明已经很清楚了吧。