ProAnswers.org

How to Terminates the running program and the current JVM?

public static void exit (int status)

You normally pass 0 to indicate that a normal exit.

A nonzero indicate an error.

 

public class MainClass {

 

  public static void main(String[] a) {

    System.exit(0);

  }

}