我不知道为什么这段代码会出错。
public class TestIf {
boolean money = true; // { <- This resolves the error.
if (money) {
System.out.println("Take a taxi");
}
else {
System.out.println("Walk");
}
// } <- This resolves error.
}
布尔值不是变量,而是一种循环吗?我根本听不懂。帮我!预先感谢。