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