public class Demo07 { public static void main(String[] args) { //三元运算符 // x ? y : z //如果x为真则输出y,如果x为假则输出z int score = 80; String type = score < 60?"不及格":"及格"; System.out.println(type);//及格 } }