hc学习平台

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

请问采用命令行方式java Example 2运行该程序,运行结果是什么  

2022-08-01 20:48:02 查看(6) 回复(0)

public  class  Example{
    public  static  void  main(String  args[]){
        Integer  intObj=Integer.valueOf(args[args.length-1]);
        int  i=intObj.intValue();
        if(args.length>1)
            System.out.println(i);
        if(args.length>0)
            System.out.println(i-1);
        else
            System.out.println(i-2);
    }
}

A、打印输出2
B、打印输出1
C、打印输出0
D、打印输出Example-1
E、打印输出Example
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

返回顶部