devxlogo

Extending Simple Enum Values to Be Composite

Extending Simple Enum Values to Be Composite

Have you felt a need for enums to have composite values?

They can be defined internally within the enum as below:

Public enum livingObjects {Humans,Animals,Plants,All = Humans | Animals | Plants}

devx-admin

Share the Post: