String intern方法
程序员文章站
2022-04-27 11:52:46
...
String a = "ab"; String b = new String("ab"); System.out.println(a == b); System.out.println(a.equals(b)); System.out.println(b.intern() == a); System.out.println(a.intern() == b);