请问为什么结果不是想象中的那样?
public static void main(String[] args)
{
test(1);
test(2);
test(3);
test(4);
}
public static void test(int a)
{
switch (a)
{
case 1:
case 2:
System.out.println("OK2");
break;
case 3:
System.out.println("OK3");
break;
default:
System.out.println("default");
break;
}
}