Tag: String

0

String constant pool

먼저 코드를 보자 12345678String str1 = "hello";String str2 = "hello";String newString = new String("hello");String intern = newString.intern();System.out.println(str1 == str2); // trueSystem.out.println(str1