public class Main {
public static void main(String [] args) {
Main main = new Main();
String str = "abc" ;
char[] array = {'a','b','c'};
change(str,array);
System.out.println(str + " " + String.valueOf(array));
}
public static void change(String str , char[] array) {
str = "cba";
array[0] = 'g';
}
}
运行结构为:abc gbc,不知道这是为啥?