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都是最新版本的
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都是最新版本的
报什么错?
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;
}
}
}
运行的好好的啊!!