How to Exit Program in Java?
We have System.exit() method in java which is responsible for exiting the running program by terminating the JVM (Java Virtual Machine). In this blog, we will be learning about this exit method in a more detailed way along with suitable examples. The exit method is available in the java.lang.System Class. Whenever we face an abnormal …