Integer和int类型的判断
来源:互联网 发布:毒理数据 编辑:程序博客网 时间:2024/06/07 13:07
测试一下Integer(1)和int num=1是否相等
以下为测试代码:
public static void main(String[] args) {
Set selects = new HashSet<>();
selects.add(1);
selects.add(3);
selects.add(4);
int count = 10; Set unSelects = new HashSet<>(); for (int i = 0; i < count; i++) { if (!selects.contains(i)) unSelects.add(i); } System.out.println(unSelects);}
测试结果表明,对象Integer和对应的int是相等的
运行结果:[0, 5, 6, 7, 8, 9]
0 0
- Integer和int类型的判断
- Integer和int类型的判断
- Integer和int基本类型的比较
- Integer 和 int 判断相等
- 关于integer和int判断相等
- Integer类型、int类型类型、String类型的相互转换
- int 和 Integer 的区别
- int 和 Integer 的区别
- int和Integer的区别
- int和Integer的区别
- int 和 integer的区别
- Integer和int的区别
- Integer 和 int 的区别
- int和integer的区别
- int和Integer的区别
- int 和integer的区别
- int和Integer的不同
- int 和 Integer的区别
- UITabBarController的使用 和 modal的使用方式
- 欢迎使用CSDN-markdown编辑器
- SEO站内分析工具:Screaming Frong的安装使用
- 关于Android中的生命周期
- 289. Game of Life
- Integer和int类型的判断
- Linux ASoC音频驱动架构 及 Machine驱动代码分析
- 仿百度首页登陆框拖拽效果(可视窗口内拖动)
- Haffman Encoding and Decoding
- MyBatis Generator XML 配置参考
- 操作系统---相关概念
- pywin32中安装问题
- scrollview嵌套listview的解决方案
- win to go 给移动硬盘装双系统