sean_gao(大胃)同志说的对,如果外面不用这个值的话,随你返回什么整数值都是一样。

解决方案 »

  1.   

    sean_gao(大胃)   说的是。和 C 的 main 的返回值意义一样,是用于系统或者其他调用程序进行判断程序退出的原因的。
      

  2.   

    正如楼上几位所言举个例子,在某个bat里(但愿您会batch)java abc.HelloWorldECHO exit=%ERRORLEVEL%IF ERRORLEVEL 0 ECHO 正常结束,或者调用了System.exit(0)
    IF ERRORLEVEL 1 ECHO System.exit(1)其实两者都不是“正常”退出
    try {
      System.exit(0); //试试return或者throw
    } finally {
      System.out.println("!!!!!"); //这行,无论return, throw都会执行,但是System.exit却不是
    }
      

  3.   

    shine333(enihs) 网友的例子不错!
      

  4.   

    exit 
    public static void exit(int status)
    Terminates the currently running Java Virtual Machine. 
    The argument serves as a status code; 
    by convention, 
    a nonzero status code indicates abnormal termination. 
    This method calls the exit method in class Runtime. 
    This method never returns normally. 
    The call System.exit(n) is effectively equivalent to the call:  
    Runtime.getRuntime().exit(n)