How do I declare a nested enum?

后端 未结 12 936
借酒劲吻你
借酒劲吻你 2020-12-08 18:29

I want to declare a nested enum like:

\\\\pseudocode
public enum Animal
{
  dog = 0,
  cat = 1
}

private enum dog
{
   bulldog = 0,
   greyhound = 1,
   hus         


        
12条回答
  •  北海茫月
    2020-12-08 19:09

    I don't think it works that way.

    Enumerations are supposed to be a simple set of parallel values.

    You may want to express that relationship with inheritance.

提交回复
热议问题