Terminating the Application - Java Java Virtual Machine

Java examples for Java Virtual Machine:Utility

Description

Terminating the Application

Demo Code


public class Main {

  public void m() {
    // No errors/*from  w w w.  j  a v  a  2 s . co  m*/
    int errorCode = 0;

    // An error occurred
    errorCode = -1;

    // Terminate
    System.exit(errorCode);
  }
}

Related Tutorials