String s1=new String("code"); String s2="code"; String s3 ="code"; 此时s2==s3为true,因为s1在堆中创建之后,常量池也会创建一个副本,s2,s3都指向该副本。