Answers for "enums with description in java"

0

enums with values in java

public enum Element {
    H("Hydrogen"),
    HE("Helium"),
    // ...
    NE("Neon");

    public final String label;

    private Element(String label) {
        this.label = label;
    }
}
Posted by: Guest on July-25-2021
0

Enums injava

public enum Day {
    SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
    THURSDAY, FRIDAY, SATURDAY 
}
Posted by: Guest on February-27-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language