这个java程序的运行结果为什么是AB,B?? 我是个学渣说的详细点,拜托 15
publicclassTest28{publicstaticvoidmain(String[]args){StringBuildera=newStringBuilder(...
public class Test28 {
public static void main(String[] args){
StringBuilder a=new StringBuilder("A");
StringBuilder b=new StringBuilder("B");
operate(a,b);
System.out.println(a+","+b);
}
static void operate(StringBuilder x,StringBuilder y){
x.append(y);
y=x;
}
} 展开
public static void main(String[] args){
StringBuilder a=new StringBuilder("A");
StringBuilder b=new StringBuilder("B");
operate(a,b);
System.out.println(a+","+b);
}
static void operate(StringBuilder x,StringBuilder y){
x.append(y);
y=x;
}
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询