为什么Java的concat()方法不做任何事情?
此代码:
String s = "TEST";
String s2 = s.trim();
s.concat("ING");
System.out.println("S = "+s);
System.out.println("S2 = "+s2);
结果如下:
S = TEST
S2 = TEST
BUILD SUCCESSFUL (total time: 0 seconds)
为什么“TEST”和“ING”没有连接在一起?