// Java class Problem extends Exception{ Problem(){super();} Problem(String s) {super(s);} } public class CatchOrSpecifyDemo1 { public static void main(String[] args){ try { explosion(); } catch (Problem e) { System.out.println("We handled the problem!"); System.out.println("Or did we?"); } // try } static void explosion() throws Problem{ System.out.println("Explosion!"); throw new Problem("We have an explosive problem"); } }