AtomicReference | int 和long类型转化 | Optional.ofNullable

AtomicReference参考网址:https://www.jianshu.com/p/5521ae322743   这个类在项目中有使用到过。

int 和 long类型互转:

    public long say(int i) {
        return i+3;
    }


    public static void main(String[] args) {
        Test test = new Test();
        System.out.println(test.say(1));
    }

运行结果:4 

可见int类型是能够自动转化成Long类型的。

 

Optional.ofNullable

参考网址:https://blog.csdn.net/zym_1321/article/details/107769743

AtomicReference | int 和long类型转化 | Optional.ofNullable

上一篇:5.字符串、列表、元祖常用操作


下一篇:[SAA + SAP] 16. RDS