public class Xuanze {
enum WashChoice {cotton,linen,wool,synthetic}

public static void main(String []args){
WashChoice wash=WashChoice.cotton;
int clothes =3;

switch(clothes){
case 1:
System.out.println("Washing shirts.");
wash = WashChoice.cotton;
break;
case 2:
System.out.println("Washing shirts.");
wash = WashChoice.linen;
break;
case 3:
System.out.println("Washing shirts.");
wash = WashChoice.wool;
break;
case 4:
System.out.println("Washing shirts.");
wash =WashChoice.synthetic;
break;
default:
System.out.println("Unknown washing - default synthetic.");
break;
}
}
}
为什么这个小程序用DOS可以调试运行,用Eclipse就不行呢?我的JDK,Eclipse都是最新版本的

解决方案 »

  1.   

    你Eclipse怎么个不行法……
    报什么错?
      

  2.   


    public class AFDSA {
    enum WashChoice {
    cotton, linen, wool, synthetic
    } public static void main(String[] args) {
    WashChoice wash = WashChoice.cotton;
    int clothes = 3; switch (clothes) {
    case 1:
    System.out.println("Washing shirts1.");
    wash = WashChoice.cotton;
    break;
    case 2:
    System.out.println("Washing shirts2.");
    wash = WashChoice.linen;
    break;
    case 3:
    System.out.println("Washing shirts3.");
    wash = WashChoice.wool;
    break;
    case 4:
    System.out.println("Washing shirts4.");
    wash = WashChoice.synthetic;
    break;
    default:
    System.out.println("Unknown washing - default synthetic.");
    break;
    }
    }
    }
    运行的好好的啊!!
      

  3.   

    什么错,说来听听,既然能运行就是Eclipse没配置的好吧
      

  4.   

    什么错,说来听听,既然能运行就是Eclipse没配置的好吧