日期:2014-05-20 浏览次数:20695 次
public class Test {
public static void main(String[] args) {
String s1 = "abc";
String s2 = "abc";
String s3 = "abcabc";
String s4 = "abc" + "abc";
String s5 = s1 + s2;
String s6 = ( s1 + s2 ).intern();
System.out.println( s3 == s4 );
System.out.println( s3 == s5 );
System.out.println( s3 == s6 );
}
}