KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > javadoc > method > Test2


1 package test.javadoc.method;
2 /** Test 2. */
3 public class Test2 {
4
5     /** Exception 1.
6      */

7     class TestException1 extends Exception JavaDoc {
8         /** Exception 1.
9          * @param messg message
10          */

11         TestException1(String JavaDoc messg) {
12             super(messg);
13         }
14     }
15     /** Exception 2.
16      */

17     public static class TestException2 extends Exception JavaDoc {
18         /** Exception 2.
19          * @param messg message
20          */

21         TestException2(String JavaDoc messg) {
22             super(messg);
23         }
24     }
25     /** Do 1.
26      * @throws TestException1 when error occurrs.
27      */

28     public void doStuff1() throws TestException1 {
29         try {
30             doStuff2();
31         } catch (TestException2 e) { }
32         throw new Test2().new TestException1("");
33     }
34     /** Do 2.
35      * @throws TestException2 when error occurrs.
36      */

37     private static void doStuff2() throws TestException2 {
38         throw new TestException2("");
39     }
40 }
41
Popular Tags