Java System.exit(int status)
Syntax
System.exit(int status) has the following syntax.
public static void exit(int status)
Example
In the following code shows how to use System.exit(int status) method.
public class Main {
// ww w. j av a 2s.c o m
public static void main(String[] args) {
System.out.println("exit...");
System.exit(0);
}
}
The code above generates the following result.