用eclipse写程序,用到enum
系统提示:
the type Enum is not generic;it can not be parameterized with arguments
是怎么回事?

解决方案 »

  1.   

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

  2.   

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

  3.   

    是不是在enum中使用了泛型?把你的代码贴出来看看?
      

  4.   

    the type Enum is
    这里的提示是Enum,而不是enum
      

  5.   

    贴一下代码。
    另外,细说一下你在eclipse中编译该工程所使用Java版本。