下面程序的运行结果是()
String str1 = "hello";String str2 = "he" + new String("llo");System.err.println(str1 == str2);
String str1 = "hello";
String str2 = "he" + new String("llo");
false
因为str2中的llo是新申请的内存块,而==判断的是对象的地址而非值,所以不一样。如果是String str2 = str1,那么就是true了。
来我收藏夹吃灰吧!
列举一款你常用的移动APP,并分析他的最核心功能、满足的需求、超预期的功能以及竞争优势和发展趋势
从浏览器输入URL到展示页面的全流程是怎么样的?
cookies,sessionStorage 和 localStorage 的区别?
什么是 Cookie?它的作用是什么?
来我收藏夹吃灰吧!