Java Runtime.exit(int status)

Syntax

Runtime.exit(int status) has the following syntax.

public void exit(int status)

Example

In the following code shows how to use Runtime.exit(int status) method.


//ww w  .  j  a  v  a  2s  .  c  o  m


public class Main {

   public static void main(String[] args) {

      // cause the program to exit
      Runtime.getRuntime().exit(0);


   }
}




















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable