标题: 下面的方法,当输入为2的时候返回值是多少? [打印本页] 作者: 壊亊唑侭 时间: 2015-8-23 21:37 标题: 下面的方法,当输入为2的时候返回值是多少? public static int getValue(int i) {
int result = 0;
switch (i) {
case 1:
result = result + i;
case 2:
result = result + i * 2;
case 3:
result = result + i * 3;
}
return result;
}
A.0
B.2
C.4
D.10