慕斯9348027
2019-11-14 19:39
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(!b +"通过");
    System.out.println(!a+"未通过");
System.out.println(c || d+"通过");
    
 }
}
				需要单独括起来,不过也可以写成
System.out.println(a&&b);
				System.out.println((a && b)+"未通过");
System.out.println((c || d)+"通过");
				System.out.println(a && b+"未通过"); a && b 需要单独括起来
				输出要在变量中声明,例如boolean e = a&&b;System.out.println(e+"未通过");
Java入门第一季(IDEA工具)
1168112 学习 · 18754 问题
相似问题