System.exit(int status) has the following syntax.
public static void exit(int status)
In the following code shows how to use System.exit(int status) method.
public class Main { public static void main(String[] args) { System.out.println("exit..."); System.exit(0); } }
The code above generates the following result.