三元运算符
package operator;
public class demo06 {
public static void main(String[] args) {
//三元运算符 x ? a : b
//如果x=true,则结果为a,否则结果为b
int x = 50;
String result = x > 60 ? "及格":"不及格";
System.out.println(result);//结果为不及格
}
}
标签:String,运算符,result,不及格,三元,public
From: https://www.cnblogs.com/sara0618/p/17089816.html