hc学习平台

 找回密码
 立即注册
搜索
热搜: 活动 交友 javakc
 › zsl520 › 日志

指出下列程序运行的结果  

2022-08-17 19:30:15 查看(131) 回复(0)

public  class  Example{  
      String  str=new  String(″good″);  
      char[  ]ch={′a′,′b′,′c′};  
      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);  
      }  
      public  void  change(String  str,char  ch[  ]){  
            str=″test  ok″;  
            ch[0]='g';  
      }  
}  
A、test  ok  and  gbc
B、good  and  gbc
C、test  ok  and  abc
D、good  and  abc
B

评论 (0 个评论)

facelist

全部作者的其他最新日志



站点统计|举报|Archiver|手机版|小黑屋|Comsenz Inc.

GMT+8, , Processed in 0.195171 second(s), 9 queries .

Powered by javakc! X1.0

© 2004-2014 javakc

f1208.com 备案号:京ICP备14030918号-1

返回顶部