java 基础问题请问为什么输出的还是“123”
程序代码:
package test_demon; public class try1 { String str1 =new String("123"); public void change(String str) { str = "ok"; } public static void main(String[] args) { try1 ex= new try1(); ex.change(ex.str1); System.out.print(ex.str1); } }