KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SuperClass


1 /* SuperClass.java */
2
3 /** Tests complex constructor. */
4
5 public class SuperClass implements org.quilt.cl.RunTest {
6
7     private String JavaDoc value = "not initialized";
8
9     public SuperClass( String JavaDoc v ) {
10         value = v;
11     }
12
13     public SuperClass() {
14         value = "SuperClass";
15     }
16
17     public String JavaDoc getValue() {
18         return value;
19     }
20
21     public int runTest(int x) {
22         if (!getValue().equals("SuperClass"))
23             throw new RuntimeException JavaDoc(
24                                     "DefaultConstructor not called.");
25         return 3*x;
26     }
27 }
28
Popular Tags