hc学习平台

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

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

2022-08-17 17:19:10 查看(69) 回复(0)

public  class  Example{
    public  static  void  add3(Integer  i){
        int  val=i.intValue();
        val+=3;
        i=new  Integer(val);
    }
    public  static  void  main(String  args[]){
        Integer  i=new  Integer(0);
        add3(i);
        System.out.println(i.intValue());
    }
}
A、运行期,第2行抛出异常
B、打印输出3
C、打印输出0
D、代码编译失败
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

返回顶部