代码阅读题-三目运算符
public class Test{
public static void main(String[] args) {
int x = 1;
System.out.println("value is"+((x>0)?99:9.9));
// 99.0
}
}
以两个数中更高的精度输出
public class Test{
public static void main(String[] args) {
int x = 1;
System.out.println("value is"+((x>0)?99:9.9));
// 99.0
}
}
以两个数中更高的精度输出