62,620
社区成员
发帖
与我相关
我的任务
分享
public class Test {
public static void main(String[] args) {
String x = "A";
String y = "B";
operate(x,y);
System.out.println(x + "," + y);
}
static void operate(String x, String y) {
x = x+y;
y = x;
}
}
public class Test {
public static void main(String[] args) {
StringBuffer x = new StringBuffer("A");
StringBuffer y = new StringBuffer("B");
operate(x,y);
System.out.println(x + "," + y);
}
static void operate(StringBuffer x, StringBuffer y) {
x = x.append(y);
y = x;
}
}