Java基础 —— “==”
基本类型用判断是否相等时,是指两个变量的值是否相等
引用类型用判断是否相等时,是指两个变量指向对象的内存地址是否相等
int numberA = 10;
int numberB = 10;
int numberC = numberA;
System.out.println(numberA==numberB);
System.out.println(numberC==numberB);
int[] arrayA = new int[5];
int[] arrayB = new int[5];
int[] arrayC = arrayA;
System.out.println(arrayA==arrayB);
System.out.println(arrayC==arrayA);
System.out.println(arrayA);