public class HelloWorld {
public static void main(String[] args) {
boolean a = true; // a同意
boolean b = false; // b反对
boolean c = false; // c反对
boolean d = true; // d同意
System.out.println((a&&b)+"未通过");
System.out.println((a||d)+"通过");
System.out.println((!a)+"未通过");
System.out.println((c^d)+"通过");
}
}
有错么?我觉得是对的呀,但不显示正确
输出的右括号是中文的 改成英文 输出结果为:
false未通过
true通过
false未通过
true通过
看着没什么问题,把代码格式整理一下试试