package test;
public class ChangeValue {
String str = new String("Hello");
char[] cb = {'a', 'b', 'c'};
public void chnage(String str, char ch[]) {
str = "HelloWorld";
ch[0] = 'b';
ch[1] = 'b';
}
public static void main(String[] args) {
ChangeValue ex = new ChangeValue();
ex.chnage(ex.str,ex.cb);
System.out.println(ex.str);
System.out.println(ex.cb);
}
}
我觉得结果是 HelloWorld a,b,c
实际上是。。Hello b,b,c
java基础有点废物啊。。得努力努力了