指出下列程序运行的结果public class Example{ String str=newString("good"); c

指出下列程序运行的结果public class Example{ String str=newString("good"); char[]ch={'a','b','c'}; public static voidmain(String args[]){ Example ex=new Example();ex.change(ex.str,ex.ch); System.out.print(ex.str+" and ");Sytem.out.print(ex.ch); } public void change(String str,charch[]){ str="test ok"; ch[0]='g'; } } () AA good and abc Bgood and gbc Ctest ok and abc Dtest ok and gbc

时间:2023-09-10 16:44:01

相似题目