In practice of course it is very unlikely to happen, but: Is there any reason for this method call not to terminate the JVM?
Is it possible for example, that an OutOfMemoryError
is thrown immediately after (or while) calling System.exit(0)
or that a StackOverflowError
occurs when calling this method, because the stack is just overflowing in that moment?
Is there any reason for this method call not to terminate the JVM?
Yes.
From the docs:
Throws:
SecurityException - if a security manager exists and its checkExit method doesn't allow exit with the specified status.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With