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

© heshiwei 高级黑马   /  2015-10-17 09:17  /  1264 人查看  /  8 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

24. 指出下列程序运行的结果
  1. public class Example {

  2.     String str = new String("good");

  3.     char[] ch = { 'a', 'b', 'c' };

  4.     public static void main(String args[]) {

  5.         Example ex = new Example();

  6.         ex.change(ex.str, ex.ch);

  7.         System.out.print(ex.str + " and ");

  8.         System.out.print(ex.ch);

  9.     }

  10.     public void change(String str, char ch[]) {

  11.         str = "test ok";

  12.         ch[0] = 'g';

  13.     }
  14. }
复制代码

A、 good and abc
B、 good and gbc
C、 test ok and abc
D test ok and gbc
游客,如果您要查看本帖隐藏内容请回复


8 个回复

倒序浏览
护发赴湖南凤凰;可发哪家
回复 使用道具 举报
是选B吗
回复 使用道具 举报
b                     
回复 使用道具 举报
1111111111111111
回复 使用道具 举报
464684897894654654
回复 使用道具 举报
非常实用
回复 使用道具 举报
hhhhhhhhhhhhhhhhhh
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马