A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

© gsa798780633 中级黑马   /  2016-4-12 20:19  /  308 人查看  /  1 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文


下面程序的运行结果
public class Example{  
String str=new String(″good″);  
char[]ch={′a′,′b′,′c′};  

public void change(String str,char ch[]){  s
tr=″test ok″;  
ch[0]=′g′;
  }  


public static void main(String args[]){  
Example ex=new Example();  
ex.change(ex.str,ex,ch);  
System.out.print(ex.str+″and″);  
System.out.print(ex.ch);
}  
}
A.good and abc           B.good and gbc           C.test ok and abc         D.test ok and gbc

您需要登录后才可以回帖 登录 | 加入黑马