何时使用system.exit(0)? [英] When to use system.exit(0)?
本文介绍了何时使用system.exit(0)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以解释一下system.exit(0)的用法吗?
当我们调用此方法(特别是参数值)时,内部会发生什么? 0,1,2,3..etc
Can anyboby please explain the use of system.exit(0)?
What will happen internaly when we call this method especially the argument value? 0,1,2,3.. etc
推荐答案
System.exit将要求VM进程停止,并返回代码将是参数中给定的代码。常见的代码是:0表示成功,1表示错误127,Unix使用128-255并映射到信号。
System.exit will ask the VM process to stop, and the code returned will be the code given in parameter. Common codes are: 0 for success, 1 to 127 for error, 128-255 is used by Unix and mapped to signals.
这篇关于何时使用system.exit(0)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文