本帖最后由 张子凯 于 2013-5-1 17:28 编辑
求以下代码错误地方,谢谢,这段代码是高新技术1的16视频。。。。我死活找不出问题。。。。- package cn.itcast.day1;
- public class EnumTest {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- }
-
- 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(time){this.time = time;}
- }
- }
复制代码 |