Dave's Brain

Browse - Programming Tips - How can I make a Java program (or app or servlet) crash?

Date: 2012oct24
Language: Java

Q.  How can I make a Java program (or app or servlet) crash?

A.  Here's some code that does it nicely:

String crashy = null; if (crashy.equals("bang")) { return; }
This should also:
assert false : "Let's crash";

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.