KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Test78


1
2
3
4 class Aaa {
5
6     public class Ccc {
7         public int yy;
8
9     public Ccc() {
10         yy = 4;
11     }
12
13     public void bar() {
14     System.out.println(Aaa.this.x + this.yy);
15     class BBB {
16         int u = 0;
17         public void bar2() {
18         ddd.bar3();
19         System.out.println(Aaa.this.x + this.u + Aaa.Ccc.this.yy);
20          }
21         class Ddd {
22         int v = 0;
23         public void bar3() {
24             System.out.println(BBB.this.u + this.v); }
25         }
26         public Ddd ddd;
27             public BBB() {
28         ddd = new Ddd();
29             }
30     }
31     BBB b = new BBB();
32     b.bar2();
33     }
34     }
35
36     public int zz;
37
38     public int x;
39
40     public Ccc ccc;
41     public Aaa() {
42        ccc = new Ccc();
43        x = 3;
44     }
45 }
46
47 public class Test78 {
48
49
50     public static void main(String JavaDoc[] args) {
51     Aaa aaa = new Aaa();
52     System.out.println(aaa.x);
53     aaa.ccc.bar();
54     }
55  
56 }
57
Popular Tags