1、String str1 = new String(“hello”);String str2 = new String(“hello”);为什么str1和str2不是同一对象2、String str1= “hello”;String str2= “hello”;第二个确实同一对象
因为它们虽然字面值一样,但是存放在不同的地址上,互不相干