I was reading a book on programming skills wherein the author asks the interviewee, \"How do you crash a JVM?\" I thought that you could do so by writing an infinite for-loo
Not a crash, but closer to a crash than the accepted answer of using System.exit
You can halt the JVM by calling
Runtime.getRuntime().halt( status )
According to the docs :-
"this method does not cause shutdown hooks to be started and does not run uninvoked finalizers if finalization-on-exit has been enabled".