ddd

java中的常量区肯定是内存了,姑且把它放在方法区里。

部分数据是共享的:

如基本数据类型的封装类型:Byte,Character,Short,Integer,Long,Boolean六种都有,区域【-128,127】(超过127,就放在堆里了,也就不再相等了。)

还有String类型数据:String a = "hello";String b = "hello"; a=b是正确的。

原文地址:https://www.cnblogs.com/ihanliu/p/4807904.html