三元运算符

public class demo8 {
public static void main(String[] args) {
/*三元运算符
x?y:z
x==ture则输出为y否则输出z
*/
int score1=80;
String type1=score1>60?"及格":"不及格";
System.out.println(type1);
}
posted @ 2020-08-13 16:00  即食内鬼  阅读(91)  评论(0)    收藏  举报