KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > T125r1


1
2 class Super {
3     Super(int x) {
4         method(x);
5     }
6
7     void method(int x) { }
8 }
9 class T125r1 extends Super {
10     private int i1 = 1;
11     private Integer JavaDoc i2 = new Integer JavaDoc(1);
12     void method(int x) {
13         i1 = x;
14         i2 = new Integer JavaDoc(x);
15         System.out.print("A ");
16     }
17     T125r1() {
18         super(2); // superclass calls method()
19
}
20     public static void main(String JavaDoc[] args) {
21         T125r1 t = new T125r1();
22         System.out.print(t.i1 + " " + t.i2);
23     }
24 }
25     
Popular Tags