Looking to create a hierarchical enums

  Kiến thức lập trình

So basically I want to create a enum class that has a main type that will branch out to a sub type and each sub type has a second sub type. The best example for this would be Car. Assume there Honda and a Toyota based on the enum instantiation I want that specific sub type to be limited to, like wise the the second sub typ. for example Car: Honda – Model: Civic – trim: EX, Hybrid. If Toyota – Model: Camry – trim: Sport

I tried creating a enum class for each type such as Car, Model, Trim and Constructing a enum based on that

LEAVE A COMMENT