Enum “Inheritance”

后端 未结 15 1632
野性不改
野性不改 2020-11-22 07:21

I have an enum in a low level namespace. I\'d like to provide a class or enum in a mid level namespace that \"inherits\" the low level enum.

namespace low
{
         


        
15条回答
  •  [愿得一人]
    2020-11-22 08:10

    You can perform inheritance in enum, however it's limited to following types only . int, uint, byte, sbyte, short, ushort, long, ulong

    E.g.

    public enum Car:int{
    Toyota,
    Benz,
    }
    

提交回复
热议问题