public classStringBuilderTest { public static void main(String[] args) { StringBuilders1 = newStringBuilder("hello"); StringBuilders2 = newStringBuilder("java"); show(s1,s2); System.out.println(s1+"......."+s2); } private static void show(StringBuilder s1,StringBuilder s2) { s1.append(s2); s1= s2;//这个不是付给s1了吗 } }
为什么打印结果是hellojava。。。。。Java |