开发者

Preventing JVM from executing System.exit()

how to prevent from executing System.e开发者_开发技巧xit(). If in middle of code exit() method is called. JVM should throw compile time exception


does this thread help?

Otherwise/In short, you could implement your own Security Manager like this:

class MySecurityManager extends SecurityManager {
  @Override public void checkExit(int status) {
    throw new SecurityException();
  }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜