System.exit(n);中,有时n有时为-1有时为 0 有时为10-----,究竟是什么意思?

解决方案 »

  1.   

    TO:mydeman(漫步者) 
    那么,具体的非0数字,各自代表什么意义,怎不能不同的数字,其意义是一样的吧?
    或者说,能否说说不同的数字与什么状态码对应呢?
      

  2.   

    API里既然只定义了非0数字的意思,而并没有说明1-10之间的数字各自有什么不同,那么就是说除了0时正常退出以外,其他的数字应该都表示一样的意思!
      

  3.   

    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)