逻辑与&& 两个变量都为true结果才为true
逻辑或|| 两个变量有一个为真结果才为true
逻辑非 ! 如果是真则为假,如果是假则为真
三元运算符有
z ?y : x
如果z = =true ,则结果为y,否则结果为x
package com.base; public class Demo11 { public static void main(String[] args) { // z ? y : x // 如果z==true,则结果为y,否则结果为x int score = 80; String TYPE = score<60?"不及格":"及格"; System.out.println(TYPE); } }