判断及格与否
作者:互联网
public class Demo08 {
public static void main(String[] args) {
/*
三元运算符
X ? Y : Z
如果x==true,则结果为Y,否则返回Z.
*/
int score = 60;
//判断及格与否
String perform = score < 60?"不及格":"及格";
System.out.println(perform);
}
}
输出:
及格
Process finished with exit code 0
标签:及格,判断,String,perform,与否,60,score,public 来源: https://www.cnblogs.com/gracewqy/p/15164943.html