Terminate virtual machine using System class : System « Development Class « Java






Terminate virtual machine using System class

      


public class Main {

  public static void main(String[] args) {

    System.exit(0);

  }

}

   
    
    
    
    
    
  








Related examples in the same category

1.Terminate a Java application
2.Exiting a Java program
3.Run object finalization using System class
4.Run the garbage collector using System class
5.Reading Text from Standard Input
6.Get file separator using System class
7.System Level Utils
8.Utilities relating to the version of Java in use at runtime
9.System IO Redirect
10.Helpers for java.lang.System
11.Methods to aid classes recover from OutOfMemoryErrors by denying or reducing service rather than a complete shutdown of the JVM.
12.A window that displays the bytes sent to System.out and System.err
13.This program runs the Sieve of Erathostenes benchmarkThis program runs the Sieve of Erathostenes benchmark