首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

java integer long 转换_longLong)与int(Integer)之间的转换

1.将long型转化为int型,这里的long型是基础类型: long a = 10; int b = (int)a; 2.将Long转换为int 型的,这里的Long型是包装类型: Long a =...10; int b=a.intValue(); 3.将Long转换为 Integer 型的,这里的Long型是包装类型: Long a = 10;; Integer b=a.intValue();...4.将int型转化为long型,这里的int型是基础类型: int a = 10;long b = (int)a; 5.将Integer型转化为long型,这里的Integer型是包装类型: int a...= 10;Long b = a.longValue(); 6.将Long型转化为Integer型,这里的Integer型是包装类型: Long a = 10; Integer b=a.longValue...(); 总结:这里的转化就是要注意Java的八种基础数据类型以及八种包装数据类型的区别 基本类型和封装类的转换 Int转Integer: Integer integer = new Integer(int

4.3K20
您找到你想要的搜索结果了吗?
是的
没有找到
领券