为什么这段Java程序输出为hello?
publicclassTest{publicstaticvoidmain(String[]args){Stringa="hello";change(a);System.o...
public class Test {
public static void main(String[] args){
String a = "hello";
change(a);
System.out.println(a);
}
public static void change(String name){
name = "world";
}
} 展开
public static void main(String[] args){
String a = "hello";
change(a);
System.out.println(a);
}
public static void change(String name){
name = "world";
}
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询