解决方案 »

  1.   

    调试吧。 string 转 number 出错了。不是数字。
      

  2.   

    你看看错误定位到哪行了double n1 = Double.parseDouble(args[0]);
    double n2 = Double.parseDouble(args[2]);
    估计八成在这两行出问题了
      

  3.   

    你可以在
    double n1 = Double.parseDouble(args[0]);
    double n2 = Double.parseDouble(args[2]);
    这2行之前加上几句
    System.out.println(arg[0]);
    System.out.println(arg[2]);看看出来的到底是什么,报错的意思是应该是这2个出现了非数字的内容
      

  4.   

     /**
         * Returns a new <code>double</code> initialized to the value
         * represented by the specified <code>String</code>, as performed
         * by the <code>valueOf</code> method of class
         * <code>Double</code>.
         *
         * @param      s   the string to be parsed.
         * @return the <code>double</code> value represented by the string
         *         argument.
         * @exception NumberFormatException if the string does not contain
         *            a parsable <code>double</code>.
         * @see        java.lang.Double#valueOf(String)
         * @since 1.2
         */
        public static double parseDouble(String s) throws NumberFormatException {
    return FloatingDecimal.readJavaFormatString(s).doubleValue();
        }
      

  5.   

    我用你的程序运行了一下
    1 * 3 的时候 
    System.out.println(args[2]);
    输出的结果是一个长字符串
      

  6.   

    用 *的时候 我把args参数都给输出出来了发现里面的信息包括我当前路径的文件信息