==在对象、基本类型、Integer类中的使用
来源:互联网 发布:什么是bim软件 编辑:程序博客网 时间:2024/06/06 00:56
public class Test2 { public static void main(String[] args) { String str1=new String("hello"); String str2=new String("hello"); System.out.println(str1==str2?0:1); String str3="hello"; String str4="hello"; System.out.println(str3==str4?0:1); Integer a=127; Integer b=127; System.out.println(a==b?0:1); Integer c=129; Integer d=129; System.out.println(c==d?0:1); }}
结果为:1 0 0 1
注:Integer 类型的值在[-128,127] 期间,Integer 用 “==”是判断的为值;超出范围则为对象,按对象进行比较。
0 0
- ==在对象、基本类型、Integer类中的使用
- ==在Integer中和String类中的使用问题
- mybatis在使用integer类型
- ArrayList<Integer> list = new ArrayList<Integer>(); 在这个泛型为Integer的ArrayList中存放一个String类型的对象。
- ArrayList<Integer> list = new ArrayList<Integer>();在这个泛型为 Integer 的 ArrayList 中存放一个 String 类型的对象。
- PHP基本类型integer
- 基本数据类型对象包装类Integer parseXxx
- 基本数据类型对象包装类-Integer
- JAVA中的类型和对象(Integer和Int)
- PHP 中的integer 类型
- Java的Integer类型使用==与equals
- Integer类型 == 比较
- Java中的Integer对象
- 如何使用integer类型
- java面试要点---ArrayList list = new ArrayList(); 在这个泛型为Integer的ArrayList中存放一个String类型的对象。
- java基本类型的对象类型在集合的判断
- java中尽量使用integer等封装类型,除非是计算少用基本类型
- JNI中如何在本地代码C++中操作java中的基本类型的数组以及对象数组
- 2.请求安全-- 如何验证请求的唯一性
- 黑白棋经典残局(1)
- 3.请求安全-- 结合使用的安全优势总结
- 01.程序和cpu
- Ubuntu 16.04中安装Vim 8.0
- ==在对象、基本类型、Integer类中的使用
- 程序员的绘画
- 【c】杨辉三角
- WebSocket的进一步实例
- 自定义折线图
- yii2.0应用介绍
- GITHUB自学系列之一「初识 GITHUB」
- IOS百度地图屏幕坐标与经纬度坐标的转换
- Pattern Matching