当前位置: 代码迷 >> J2SE >> eclipse中enum有关问题
  详细解决方案

eclipse中enum有关问题

热度:8336   发布时间:2013-02-25 00:00:00.0
eclipse中enum问题
用eclipse写程序,用到enum
系统提示:
the type Enum is not generic;it can not be parameterized with arguments
是怎么回事?the type Enum is
这里的提示是Enum,而不是enum
public enum XXX {
A(0),
//没有中间页
B(1);
private int code;

private XXX (int code){
this.code=code;
}

public int getCode() {
return code;
}

public void setCode(int code) {
this.code = code;
}
package com.lss.tm.enums;

//参考一下。我经常会这样写
public enum Status {
Normal(1, "正常"), Freeze(0, "冻结");
private Integer id;
private String name;

private Status(Integer id, String name) {
this.id = id;
this.name = name;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}
}
是不是在enum中使用了泛型?把你的代码贴出来看看?贴一下代码。
另外,细说一下你在eclipse中编译该工程所使用Java版本。
  相关解决方案