Extending an enum via inheritance

后端 未结 15 2512
温柔的废话
温柔的废话 2020-11-27 17:40

I know this rather goes against the idea of enums, but is it possible to extend enums in C#/Java? I mean \"extend\" in both the sense of adding new values to an enum, but a

15条回答
  •  余生分开走
    2020-11-27 18:07

    You can't inherit from/extend an enum, you can use attributes to declare a description. If you're looking for an integer value, that's built-in.

提交回复
热议问题