char operator; int a,b; operator= '+'; a=6; b=2; switch

char operator; int a,b; operator= '+'; a=6; b=2; switch (operator){ case '+': System.out.println(a+b); case '-':System.out.println(a-b); case '*':System.out.println(a*b); break; case '/':System.out.println(a/b); break; default: System.out.println("无效运算符");}

以上Java代码片段输出的结果是:

A.

8

B.

12

C.

4

D.

3

正确答案是ABC