gzc426 / Java-Interview

Java 面试必会 直通BAT
6.07k stars 1.35k forks source link

String s3 = new String("1") + new String("1"); s3.intern(); String s4 = "11"; System.out.println(s3 == s4); //false not true #13

Open youngboyvip opened 4 years ago

youngboyvip commented 4 years ago

public class HelloWorld { public static void main(String []args) { String s3 = new String("1") + new String("1"); s3.intern(); String s4 = "11"; System.out.println(s3 == s4); } }

image