Can I extend a class and override enclosed enum type?

前端 未结 3 973
生来不讨喜
生来不讨喜 2021-02-05 12:43

If I have a class that contains an enum type, can I extend this class and override the enum type or add more constants to this enum? The purpose is that user will b

3条回答
  •  粉色の甜心
    2021-02-05 13:19

    Enums are exactly final inner classes that extends java.lang.Enum. You cannot extend, override or inherit an enum.

提交回复
热议问题