//三元运算符
public class Demo05 {
public static void main(String[] args) {
//x ? y :z
//如果x==true,则结果为y,否则结果为z
int score = 20;
String type = score < 60 ?"不及格" :"及格";
System.out.println(type);
}
}
标签:String,浅学,运算符,score,三元,type,public
来源: https://www.cnblogs.com/speak-please/p/16389863.html