[code=java]public class Test2{
public enum Dogs{collie,harrier};
public static void main(String [] args){
Dogs myDog = Dogs.collie;
switch(myDog){
case collie:
System.out.print("collie");
break;//在此处加break语句
case harrier:
System.out.print("harrier");
break;//在此处加break语句
}
}
}[/code]
[ 本帖最后由 杨志罡 于 2011-07-27 18:37 编辑 ] |