代码阅读题-三目运算符

public class Test{
    public static void main(String[] args) {
        int x = 1;
        System.out.println("value is"+((x>0)?99:9.9));
        // 99.0
    }
}

以两个数中更高的精度输出

posted @ 2022-09-22 12:29  YaosGHC  阅读(38)  评论(0)    收藏  举报