KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a problem in Java using Enums. I have read the documentation about assigning value parameters to Enums. But, my question is what about multiple values, is it possible? This what I would like to achieve: I have an Enum for languages. Each language is represented by its name and some shorter aliases (not always, and not always the same number of aliases) Here is an example: public enum Language{ English("english", "eng", "en", "en_GB", "en_US"), German("german", "de", "ge"), Croatian("croatian", "hr", "cro"), Russian("russian") } Can I just define an Enum like this and get the right enum values by calling Language.valueOf() ???
Tags (comma-separated)
Save Edits
Cancel