在Java中,System.exit(0)以下代码有或没有区别?
public class TestExit
{
public static void main(String[] args)
{
System.out.println("hello world");
System.exit(0); // is it necessary? And when it must be called?
}
}
Run Code Online (Sandbox Code Playgroud)
该文件说:"这种方法永远不会正常返回." 这是什么意思?
我想知道如何"杀死"一个已启动的进程.我知道Process API,但我不确定,如果我可以使用它来"杀死"已经运行的进程,例如firefox.exe等.如果可以使用Process API,请指点我进入正确的方向?如果没有,其他可用选项有哪些?谢谢.