int score = 60;int chengji = 98;String jieguo = chengji >= score ? "考试通过" : "挂科";System.out.println(jieguo);

练习:比较三个数字,取出最大值
public static void main(String[] args) {// 比较三个整数最大值int a = 100;int b = 39;int c = 87;int max = a >= b ? a : b;max = max >= c ? max : c;System.out.println(max);}

