KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ComplicatedConstructor


1 /**
2  * ComplicatedConstructor
3  *
4  * This class requires a call to Super.
5  *
6  * @author <a HREF="ddp@apache.org">David Dixon-Peugh</a>
7  */

8
9 public class ComplicatedConstructor extends SuperClass {
10     
11     public ComplicatedConstructor() {
12         super("ComplexConstructor");
13     }
14
15     public int runTest(int x) {
16         if (getValue().equals("SuperConstructor")) {
17             throw new RuntimeException JavaDoc(
18                                 "Default SuperClass Constructor called.");
19         } else if (!getValue().equals("ComplexConstructor")) {
20             throw new RuntimeException JavaDoc(
21                                 "default constructor returned " + getValue());
22         }
23
24         return 61;
25     }
26 }
27
Popular Tags