Monday, 30 January 2017

Java Tutorial: Java Runtime class (halt method)

Click here to watch in Youtube :

 * public void halt(int status)
 * Parameters: 
 * -----------
 * status - Termination status. By convention, a nonzero
 * status code indicates abnormal termination.
public class RuntimeDemo

    public static void main(String[] args) throws IOException
         * Returns the runtime object associated with the
         * current Java application.
        Runtime runtime = Runtime.getRuntime();

        System.out.println("Before halt method is called..");
         * Forcibly terminates the currently running Java
         * virtual machine.
         * This method should be used with extreme caution.
         * Unlike the exit method, this method does not
         * cause shutdown hooks to be started and does not
         * run uninvoked finalizers if finalization-on-exit
         * has been enabled. If the shutdown sequence has
         * already been initiated then this method does not
         * wait for any running shutdown hooks or finalizers
         * to finish their work.
        System.out.println("After halt method is called..");

Before halt method is called..

Click the below link to download the code:

Github Link:

Bitbucket Link:

See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • No comments:

    Post a Comment

    Google+ Followers

    Google+ Badge