Development Java Tutorial

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);
  }
}