public class InternTest {
public static void main(String[] args) {
String s = "abc";
String s2 = new String("abc");
String s3 = s2.intern();
System.out.println(s == s2);
System.out.println(s == s3);
}
}
image.png
网友评论