【‘Integer(int)‘ 已经过时了】
问题:‘Integer(int)’ 已经过时了
Integer value = new Integer(666);
原因:jdk9 之后,对Integer(int value)做了些改变
/*** Constructs a newly allocated {@code Integer} object that* represents the specified {@code int} value.** @param value the value to be represented by the* {@code Integer} object.** @deprecated* It is rarely appropriate to use this constructor. The static factory* {@link #valueOf(int)} is generally a better choice, as it is* likely to yield significantly better space and time performance.*/@Deprecated(since="9")public Integer(int value) {this.value = value;}
可以看到 @link #valueof(int)
使用后
Integer value = Integer.valueOf(666);
【‘Integer(int)‘ 已经过时了】相关推荐
- [小技巧][JAVA][转换]List, Integer[], int[]的相互转换
int[] 转 List< Integer > int[] data = {4, 5, 3, 6, 2, 5, 1}: List<Integer> list1 = Arrays ...
- java integer int 比较_java Integer和int之间的比较问题是什么?
展开全部 java Integer和int之间e68a84e8a2ad3231313335323631343130323136353331333365633864==的比较问题.求解释 public ...
- mysql Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT
使用mysql的时候,用到int类型的蛮多,需要注意一下: 1. 值的范围 Type Storage Minimum Value Maximum Value (Bytes) (Signed/Uns ...
- 为何类型转型Integer[] = Object[]可以,而Integer[] = int[]却不行
写代码的时候经常碰到这种情况,想在Integer[]和int[]之间互转,却直接提示编译期错误,很蛋疼.而Integer[]和Object[]之间却可以强转.以前一直觉得int和Integer的关系比 ...
- 7.Reverse Integer (INT; Overflow)
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 思路:要注意溢出 ...
- Integer int比较大小
1.a1 == a2 true Integer.valueof(int) 自动装箱 2.b1 == b2 false 超出范围-128-127,不同的对象 3.c1 == c2 false new,不 ...
- Java中List, Integer[], int[]的相互转换
有时候list<Integer>和数组int[]转换很麻烦. List<String>和String[]也同理.难道每次非得写一个循环遍历吗?其实一步就可以搞定. 本文涉及到一 ...
- java中包装类介绍
包装类: 基本数据类型使用起来非常方便,但是没有对应的方法来操作这些基本类型的数据,我们只有通过一个类把基本类型的数据封装起来,并在类中定义一些方法,这个类就叫做包装类. 包装类对应基本数据类型中的四 ...
- Java int 和 Integer 互转原理
文章目录 Java int 和 Integer 互转 Java Integer.int 与 new Integer() Integer.valueOf() new Integer() 为什么 Java ...
最新文章
- OSChina 周日乱弹 —— 来和养生的技术负责人决斗!
- 毕业设计记录(三)mysql的SQL语句
- Java中读取本地图片并转为base64解决办法
- c++ 预处理命令 #undef用法
- Struts2输入校验
- java中多态的例子_java中的多态案例
- 标记三维点_SSW系统在地下大型停车场三维建模中的应用研究
- Android NDK学习记录(一)
- 计算机毕业设计ssm火车站售票管理系统
- JavaScript离别之作——HTML元素操作
- 三国鼎立企查查、天眼查、微猫的三国大战
- 用python的Turtle库画一个笑脸
- Android 图片选取画图案
- 网站权重是什么意思?
- JPA使用(Querydsl)
- Chasedb1--视网膜血管分割数据集
- 可积与原函数存在的区别
- 中国企业不给加拿大授权,加拿大运营商就不能用5G专利?纯属扯谈
- 【笨嘴拙舌WINDOWS】编码历史
- 2019最新微专业Python应用基础(11周精通Python计划)
热门文章
- MobData“1024程序趴”今天所有程序猿都有妹纸!
- 三、Hadoop系统应用之Hadoop集群测试及初体验(超详细步骤指导操作,WIN10,VMware Workstation 15.5 PRO,CentOS-6.7)
- 外贸出口迷你车载冰箱亚马逊UL2089测试标准
- 基于信息共享搜索策略的自适应灰狼算法-附代码
- c语言围棋ai算法代码,晒晒围棋代码
- 【渝粤题库】陕西师范大学180105 推销策略 作业(高起专)
- 阿里天池学习赛 新闻文本分类
- 2012年的时候许其凤院士谈北斗
- 2022年学习机器人和人工智能的一些期待
- 远程桌面 重启关机等功能