public class Testoperator5 {
public static void main(String[] args) {
int score = 89;
String type = score<60?"不及格":"及格";
System.out.println(type);
}
}片
问号后面是false时返回的结果
冒号后面是true时返回的结果
public class Testoperator5 {
public static void main(String[] args) {
int score = 89;
String type = score<60?"不及格":"及格";
System.out.println(type);
}
}片
问号后面是false时返回的结果
冒号后面是true时返回的结果