Terminate virtual machine using System class - Java Java Virtual Machine

Java examples for Java Virtual Machine:Utility

Description

Terminate virtual machine using System class

Demo Code


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");
        }
}

Result


Related Tutorials