Try Catching Explosions
Okay, the basics: a try-catch block in Java is really composed of the following:
So we place any code we think might cause an exception in the try part and thecatch part is where we place code to handle the exception and the finally block executes if there's an exception thrown or not. So using a subclass of Exception, ExplosionException, we can check code for explosions and deal with them as follows:
Okay so maybe this is a useless post that does nothing more than make my blog more recently updated and let me ramble about a subject usually covered in an introductory programming course.