Java examples for Java Virtual Machine:Utility
Terminate virtual machine using System class
public class Main { public static void main(String[] args) { System.out.println("Exiting current virtual machine"); System.exit(0);// w w w . j a va 2s . c o m System.out.println("This will not be printed"); } }