public class Demo2 {
public static void main(String[] args) {// TODO Auto-generated method stub//逻辑运算符boolean a=true;boolean b=false;System.out.println("a&&b"+(a&&b));//逻辑与,只要有一个不对,就不对System.out.println("a||b"+(a||b));//逻辑或,只要有一个对,就对System.out.println("!a&&b"+!(a&&b));//逻辑非,如果是真,则变为假,如果是假,则变为真//短路运算int c=6;boolean d=(c<4)&&(c>5);System.out.println(d);System.out.println(c);
}
}