![]() ![]() ![]() | Lecture 10 - slide 11 : 26 Program 3 |
class Problem extends Exception{ Problem(){super();} Problem(String s) {super(s);} } public class CatchOrSpecifyDemo2 { static void eksplosion() throws Problem{ System.out.println("Eksplosion!"); throw new Problem("Vi har et eksplosivt problem"); } public static void main(String[] args) throws Problem { eksplosion(); } } |