以下程序显示数组索引超出范围的异常错误

时间:2016-02-29 17:38:50

标签: java

//程序找到最多两个数字

class Maxof2{

    public static void main(String args[]){
      //taking value as command line argument.
      //Converting String format to Integer value
      int i = Integer.parseInt(args[0]);
      int j = Integer.parseInt(args[1]);
      if(i > j)
        System.out.println(i+" is greater than "+j);
      else
        System.out.println(j+" is greater than "+i);
  }

}

0 个答案:

没有答案