不可变( immutable)字符串 String strl fl string str2 =weighti String str3 =flyweight"i String str4 null str4 str1 str2 System. out. println(str3 = str4) codech06\InternStr str4 (strl t str2).intern(i Ungava System. out. println(str3 str4)i ring Pool 嬖數 tr1 樊數 str2 口anaa可 變數不可变(immutable)字符串 String str1 = "fly"; String str2 = "weight"; String str3 = "flyweight"; String str4 = null; str4 = str1 + str2; System.out.println(str3 == str4); str4 = (str1 + str2).intern(); System.out.println(str3 == str4); code\ch06\InternStr ing.java