Click here to watch in Youtube :
https://www.youtube.com/watch?v=U0h2VimMOkQ&list=UUhwKlOVR041tngjerWxVccw
RuntimeDemo.java
Outputhttps://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.."); } }
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:
No comments:
Post a Comment