I have 3 enums in java:
enum A {MON,TUE,WED}
enum B{THU,FRI}
enum C{SAT,SUN}
I want to create enum D that should be the union of other enums. eg D {MON,TUE,WED,THU,FRI,SAT,SUN}
What should be the best approach to achieve this.
I have 3 enums in java:
enum A {MON,TUE,WED}
enum B{THU,FRI}
enum C{SAT,SUN}
I want to create enum D that should be the union of other enums. eg D {MON,TUE,WED,THU,FRI,SAT,SUN}
What should be the best approach to achieve this.
I take it from your question that you want to do it dynamically, at runtime. This is (technically) not possible, as enums are constants. If you want to go about and introduce some hacks to make it possible, nobody will stop you. See for a starter: https://jqno.nl/post/2015/02/28/hacking-java-enums/