Gettin enum types may not be instantiated Exception

前端 未结 3 1487
醉梦人生
醉梦人生 2021-01-21 19:43

I am getting RuntimeException

Enum types may not be instantiated

I don\'t know why. What I want is to identify a year by an intege

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-21 20:35

    You Should not call constructor in enum.

    You should call Catalog c = Catalog.year2005; like that.

提交回复
热议问题