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)
这里不会谁笑话谁的,大家讨论而已,我也不清楚,给你提供点参考.

解决方案 »

  1.   

    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)
    这里不会谁笑话谁的,大家讨论而已,我也不清楚,给你提供点参考.
      

  2.   

    谢谢 arefe(arefe),我看的不是太懂.是不是说如果我要在程序中调用:System.exit(1);我就得在Runtime里设定这个方法要实现的功能?那么该怎么设呢?它的方法名是Runtime.getRuntime().exit(int n)吗?
      

  3.   

    正如HELP中所说的:
    by convention, a nonzero status code indicates abnormal termination. 
    常态情况下,System.exit(0);为什么区分常态和非常态退出方式,就不得而知了。
      

  4.   

    那么非常态的是SUN他们定义好了的,还是要我们自己定义?如果要我们自己定义是不是该写一个exit(1)的执行代码?