public class Logic {
public static void main(String[] args) {
boolean a,b,c;
a=true;
b=false;
System.out.println("逻辑运算,其中a=TRUE,b=FALSE");
c=a&b;
System.out.println("1、a&b="+c);
c=a|b;
System.out.println("2、a|b="+c);
c=a^b;
System.out.println("3、a^b="+c);
c=!a;
System.out.println("4、!a="+c);
c=a&&b;
System.out.println("5、a&&b="+c);
c=a||b;
System.out.println("6、a||b="+c);
}
}
结果