hc学习平台

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

请问该程序的运行结果是什么  

2022-08-11 20:50:14 查看(141) 回复(0)

public  class  Example{
    public  static  void  main(String  args[  ]){
        String  str=new  String("World");
        char  ch[  ]={'H','e','l','l','o'};
        change(str,ch);
        System.out.print(str+"and"+"  ");
        for(int  i=0;  i<ch.length;  i++)
        System.out.print(ch[i]);
    }
    public  static  void  change(String  str,char  ch[]){
        str="Changed";
        ch[0]='C';
    }
}
A、打印输出Changed  and  Hello
B、打印输出Changed  and  Hello
C、打印输出World  and  Cello
D、打印输出World  and  Hello
C

评论 (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

返回顶部