📜  带有构造函数的stackoverflow java enum - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:43.886000             🧑  作者: Mango

代码示例1
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[]) {

    }

}