java

导航

java认证考试编程题(14)

来源 :中华考试网 2016-10-05

public class Test
{
    static void oper(StringBuffer c,StringBuffer d)
    {
        d = c.append("B");
    }
   
    public static void main(String[] args)
    {
        StringBuffer a = new StringBuffer("A");
        StringBuffer b = new StringBuffer("B");
        oper(a, b);
        System.out.println(a + "," + b);
    }

}


此程序会输出:AB,B

分享到

相关资讯