Java Data Type Tutorial - 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.

/*from   w  ww  .j  av a2  s.c  om*/


public class Main {

   public static void main(String[] args) {

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


   }
}