package cn.itcast.day1;
public class EnumTest
{
/**
* @param args
*/
public static void main(String[] args)
{
// TODO Auto-generated method stub
WeekDay weekDay2 = WeekDay.WED;
}
public enum WeekDay
{
SUN(333),MON,TUE(1),WED(2),THI,FRI,SAT;//这里括号里不管我写多少都会出现下面的结果,不是很明白,哪位大侠给解释解释
private WeekDay(){System.out.println("first");}
private WeekDay(int day){System.out.println("second");}
}
}
运行后的结果:
second
first
second
second
first
first
first
|