//三元运算符
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);
}
}
原创文章,作者:,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/268338.html