Terminate the running program and the current JVM in Java

Description

The following code shows how to terminate the running program and the current JVM.

You normally pass 0 to indicate that a normal exit. A nonzero indicate an error.

Example


// w  ww  . j a  v  a  2  s. c  om
  
public class Main {

  public static void main(String[] a) {
    System.exit(0);
  }

}




















Home »
  Java Tutorial »
    Development »




Java Algorithms
Java Clipboard
Java Compiler
Java Desktop
Java Virtual Machine
Java Math
OS
Random
Java Robot
Java RuntimeMXBean
Java Timer
Java UUID
Java Internationalization