枚举类型可以包含其他枚举元素以及自己的元素吗?
public enum CardSuit
{
spades,
hearts,
diamonds,
clubs
}
public enum GameSuit
{
spades, // These are
hearts, // the same
diamonds, // " CardSuit "
clubs, // elements
suns // " GameSuit " special element
}
我们能否在GameSuit中包含CardSuit,而不需要重复输入相同的元素?