本帖最后由 橸瑩膤漃寞林 于 2013-12-14 20:48 编辑
import java.util.Date;
public class EnumTest {
public static void main(String[] args) {
new Date(300){};
}
public enum WeekDay{
SUN(),MON,TUE,WED,THE,FRI,SET;
private WeekDay(){System.out.println("first");}
private WeekDay(int day){System.out.println("secend");}
}
public enum TrafficLamp{
RED(30){
public TrafficLamp nextLamp(){
return GREEN;
}
},
GREEN(45){
public TrafficLamp nextLamp(){
return YELLOW;
}
},
YELLOW(5){
public TrafficLamp nextLamp(){
return RED;
}
};
public abstract TrafficLamp nextLamp();
private int time;
private TrafficLamp(int time){this.time = time;}
}
}
这个交通灯的问题,new Date(300){};这里是什么意思,烦请解答,谢谢。
|