package com.gzxh.chapt02;
public class Ljdemo {
/**
* @content
* 逻辑运算符
* &&(短路与)and 只有两个值都为真才为真,否则都为假
* ||(短路或)or:只要有真,就是真
* !非(取反)
**/
public static void main(String[] args){
boolean x = true,y = false;
System.out.println(x && x);//true&&true true
System.out.println(x && y);//true&&false false
System.out.println(y && x);//false&&true false
System.out.println(y && y);//false&&false false
System.out.println(x || y);//true || false true
System.out.println(x || x);//true || true false
System.out.println(y || y);//false || false false
System.out.println(x || y);//false || true false
}
}