"==""equals"的堆栈图怎么画
public class HeapStackTest {
public static void main(String[] args){
String str1 = new String("abc");
String str2 = "abc";
String str3 = "abc";
System.out.println(str1 == str2);
System.out.println(str2 == str3);
int a = 5;
Integer b = new Integer(5);
Integer c = new Integer(5);
System.out.println(a == b);
System.out.println(b == c);
}
}
新手上路,想请教各位,以上程序,输出的true或false在堆栈中是如何实现的?
以上出现的数据在堆栈中是如何保存的呢?
“==”比较的是什么?
若全换成equals呢?