Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

stackoverflow java enum with constructor

public enum Day {

    SUNDAY(), MONDAY, TUESDAY(2), WEDNESDAY, THURSDAY, FRIDAY, SATURDAY;

    int value;

    private Day(int value) {
        System.out.println("arg cons");
        this.value = value;
    }

    private Day() {
        System.out.println("no arg cons");
    }

    public static void main(String args[]) {

    }

}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #stackoverflow #java #enum #constructor
ADD COMMENT
Topic
Name
6+2 =