int score=68; String mark =score>=60?"及格":"不及格"; System.out.println("考试成绩如何:"+mark);
String mark =(score>=60?"及格":"不及格");
String mark =(score>=60)?"及格":"不及格";
两种格式都正确
int score=68; String mark =(score>=60?"及格":"不及格");System.out.println("考试成绩如何:"+mark);
int score=68; String mark =(score>=60?"不及格":"及格");System.out.println("考试成绩如何:"+mark);