本帖最后由 曹冬明 于 2014-4-16 21:17 编辑
- public class TestDemo
- {
- public static void main(String[] args)
- {
- StringBuffer a = new StringBuffer("a");
- StringBuffer b = new StringBuffer("b");
- append(a,b);
-
- System.out.println(a.toString()+","+b.toString());
- b = a;
- System.out.println(a.toString()+","+b.toString());
- }
- public static void append(StringBuffer a,StringBuffer b)
- {
- a.append(b);
- b = a;
- }
- }
复制代码
为什么跟我想的结果,不一样,求解释 |