简单小题,请指教!
public class Show {String str = new String ("good");
char[] ch = {'a','b','c'};
public static void main(String[] args) {
// TODO Auto-generated method stub
Show show = new Show();
show.change(show.str, show.ch);
System.out.print(show.str+" and ");
System.out.print(show.ch);
}
public void change(String str,char ch[]){
str = "test ok";
ch[0] = 'g';
}
}
为什么运行的结果中str不是test ok 而是原来的good?