你好如何在我的android项目中使用switch循环?我想使用安卓 2.1
我需要 JRE 1.7,但我想使用 Android 2.1
我使用这样的循环:
switch ((CHAR[Math.abs(intGen.nextInt()%2)])) {
case "+":
result = random2 + random3;
break;
case "-":
result = random2 + random3;
break;
}
日志猫:
Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted