String s1 = "abc";
String s2 = new String("abc");
s2.intern();
System.out.println(s1 ==s2);

Posted on by