老师您好,string类型的,一定要有()吗?我不输入()在eclipse上 也能运行出结果,我想请问下两者的区别
package come.imooc;
public class ll {
public static void main (String[]args){
int score=68;
String mark =((score>=60)?"及格":"不及格");
System.out.println("考试成绩如何:"+mark);
}
}
package come.imooc;
public class ll {
public static void main (String[]args){
int score=68;
String mark =(score>=60?"及格":"不及格");
System.out.println("考试成绩如何:"+mark);
}
}