Answers for "enumerations java example with multiple values"

0

enum multiple values

public enum Language{
    English("english", "eng", "en", "en_GB", "en_US"),
    German("german", "de", "ge"),
    Croatian("croatian", "hr", "cro"),
    Russian("russian");

    private final List<String> values;

    Language(String ...values) {
        this.values = Arrays.asList(values);
    }

    public List<String> getValues() {
        return values;
    }
}
Posted by: Guest on May-06-2020
0

enum multiple values

public enum Language{
    English("english", "eng", "en", "en_GB", "en_US"),
    German("german", "de", "ge"),
    Croatian("croatian", "hr", "cro"),
    Russian("russian");

    private final List<String> values;

    Language(String ...values) {
        this.values = Arrays.asList(values);
    }

    public List<String> getValues() {
        return values;
    }
}
Posted by: Guest on May-06-2020

Code answers related to "enumerations java example with multiple values"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language