(8 )阅读下列程序段public class OperatorsAndExpressions {String conditionalExpression (in
(8 )阅读下列程序段
public class OperatorsAndExpressions {
String conditionalExpression (int score ) {
String result;
//如果 score 超过 60 分,则结果是 passed, 否则是 doesn't pass
result= (score>=60 ) ?"passed":"doesn't pass" :
System.out.println (result ) ;
return result;
}
public static void main (String args[] ){
OperatorsAndExpressions perAndExp=new OperatorsAndExpressionsQ;
//条件表达式
OperAndExp. conditionalExpression (65 ) ;
}
}
其执行结果是 【 8 】