String面试题
public class TestThread01 { String str = new String("good"); char[] ch = {'t','e','s','t'}; void change(String str,char[] ch){ str = "test ok"; ch[0] = 'b'; } public static void main(String[] args) { TestThread01 testThread01 = new TestThread01(); testThread01.change(testThread01.str, testThread01.ch); System.out.println(testThread01.str);//good System.out.println(testThread01.ch);//best } }