A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 啊全 中级黑马   /  2015-4-28 23:01  /  424 人查看  /  3 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

public class Prog6{
        public static void main(String[] args){
                int m,n;
                try{
                        m = Integer.parseInt(args[0]);
                        n = Integer.parseInt(args[1]);
                }catch(ArrayIndexOutOfBoundsException e){
                        System.out.println("输入有误");
                        return;

3 个回复

倒序浏览
改成如下代码就可以编译通过了,你代码少了“}”


  1. public class Test{

  2.          public static void main(String[] args){
  3.          int m,n;
  4.          try{
  5.                  m = Integer.parseInt(args[0]);
  6.                  n = Integer.parseInt(args[1]);
  7.          }catch(ArrayIndexOutOfBoundsException e){
  8.                  System.out.println("输入有误");
  9.                  return;}
  10.          }

  11. }
复制代码
回复 使用道具 举报
如果这就是你全部的代码,就是应该少了连个中括号
回复 使用道具 举报
如果你使用eclipse就可以自己知道哪里错了......挺好用的东西
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马