首页 > 其他 > 详细

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

时间:2021-08-02 23:14:36      阅读:41      评论:0      收藏:0      [点我收藏+]

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

原文:https://www.cnblogs.com/dongyaotou/p/15091635.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!