1:public class stringm 2:{ 3: 4: 5: void test() 6: { 7: String t1="string"; 8: String t2="test"; 9: String t3; 10: String t4=""; 11: 12: t3=t1.concat(t2); 13: t1+=t2; 14: String t5="stringtest"; 15: String t6="stringtest"; 16: if(t3==t5) { System.out.println("concat is from the pool"); } 17: if(t1==t5) { System.out.println("+= is from the pool"); } 18: if(t5==t6) { System.out.println("pool test"); } //only this is true 19: System.out.println("t3="+t3+" t4="+t4+" t5 ="+t5); 20: } 21: 22: public static void main(String arg[]) 23: { 24: new stringm().test(); 25: } 26:} 27: