摘要: 示例 String str1 = "abc"; String str2 = "abc"; String str3 = new String("abc"); 在str1 和str2执行的时候会在常量池中查看有没有abc的常量,如果有那么就将值赋给str1、str2。 而str3是在执行的时候在堆中直接 阅读全文
posted @ 2021-07-13 20:43 Myxin 阅读(69) 评论(0) 推荐(0)