标题: 变量赋值问题 [打印本页] 作者: youcyou 时间: 2014-9-15 14:08 标题: 变量赋值问题 代码如下:
public class Test1 {
String s = new String("good");
char[] ch = { 'a', 'b', 'c' };
Person person = new Person("zhangsan", 11);
public static void main(String args[]) {
Test1 t = new Test1();
t.changer(t.s, t.ch, t.person);
System.out.println(t.s);
System.out.println(t.ch);
System.out.println(t.person);
}
private void changer(String s2, char[] ch2, Person person) {
// TODO Auto-generated method stub
s = "ok";
ch[0] = 'g';
person = new Person("lisi", 22);