KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > NestedAnon


1
2 public class NestedAnon {
3     public NestedAnon(int maxdepth) {
4     class NestMyself {
5         int depth;
6 ///#ifndef JAVAC11
7
NestMyself son;
8 ///#endif
9

10         public NestMyself(int d) {
11         depth = d;
12 ///#ifndef JAVAC11
13
if (d > 0)
14             son = new NestMyself(d-1);
15 ///#endif
16
}
17     }
18     new NestMyself(maxdepth);
19     }
20
21 }
22
Popular Tags