How to use enum with grouping and subgrouping hierarchy/nesting
问题 I have one enum 'class' called Example as follows: enum Example { //enums belonging to group A: enumA1, enumA2, enumA3, //enums belonging to group B: enumB1, enumB2, enumB3, //enums belonging to group C: enumC1, enumC2, enumC3; } It's important for my project they all enums I work with belong to Example (since this is an argument in a constructor of a class). How do I use enum hierarchy/nesting in order to achieve the following: A method that tests whether an enum is of group A, B or C. For