欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

StringBuffer

程序员文章站 2022-07-15 10:20:00
...
public class Foo
{
      public static void main(String[] args)
      {
            StringBuffer a = new StringBuffer("A");
            StringBuffer b = new StringBuffer("B");
            operate(a,b);
            System.out.println(a+" , "+b);
      }
      
      static void operate(StringBuffer x, StringBuffer y)
      {
            x.append(y);
            y = x;
      }
}

The code compiles and prints "AB , B".