The Artima Developer Community
Sponsored Link

Java Buzz Forum
Java Tutorial: Java Runtime class (halt method)

0 replies.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a flat view of this topic  Flat View
Previous Topic   Next Topic
Threaded View: This topic has 0 replies on 1 page
Ram N

Posts: 2777
Nickname: ramram
Registered: Jul, 2014

Ram N is Java Programmer
Java Tutorial: Java Runtime class (halt method) Posted: Jan 30, 2017 4:25 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Ram N.
Original Post: Java Tutorial: Java Runtime class (halt method)
Feed Title: JAVA EE
Feed URL: http://ramj2ee.blogspot.com/feeds/posts/default?alt=rss
Feed Description: This blog has viedo tutorials and Sample codes related to below Technologies. 1.J2EE 2.Java 3.Spring 4.Hibernate 5.Database 6.Oracle 7.Mysql 8.Design Patterns
Latest Java Buzz Posts
Latest Java Buzz Posts by Ram N
Latest Posts From JAVA EE


Click here to watch in Youtube : 
https://www.youtube.com/watch?v=U0h2VimMOkQ&list=UUhwKlOVR041tngjerWxVccw

RuntimeDemo.java
import java.io.IOException;

/*
* 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.
*/

runtime.halt(0);
System.out.println("After halt method is called..");
}

}
Output
Before halt method is called..

Click the below link to download the code:
https://sites.google.com/site/ramj2eev1/home/javabasics/RuntimeDemo_halt_App.zip?attredirects=0&d=1

Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/RuntimeDemo_halt_App

Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/28b772df8f5b4b9e60fd873726243fc258cd34a2/BasicJava/RuntimeDemo_halt_App/?at=master

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
  • Read: Java Tutorial: Java Runtime class (halt method)


    Topic: Humans are easy, Computers are Hard, with Bridget Kromhout Previous Topic   Next Topic Topic: 12% off Fellowes Powershred Jam-Proof Cross-Cut Paper and Credit Card Shredder - Deal Alert

    Sponsored Links



    Google
      Web Artima.com   

    Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use