public class Question29
1: //Question29.java
2:
3: public class Question29
4: {
5: public static void main(String[] args)
6: {
7: try
8: {
9: int n = 0;
10: if (n > 0)
11: throw new Exception();
12: else if (n < 0)
13: throw new NegativeNumberException();
14: else
15: System.out.println("Hello!");
16: }
17: catch (NegativeNumberException e)
18: {
19: System.out.println("First catch.");
20: }
21: catch (Exception e)
22: {
23: System.out.println("Second catch");
24: }
25: System.out.println("End of code");
26: }
27: }