Last change
on this file was 2, checked in by bird, 22 years ago |
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
File size:
981 bytes
|
Line | |
---|
1 | // Class anon2
|
---|
2 | // Generated on Wed Dec 29 10:07:09 PST 1999
|
---|
3 | //
|
---|
4 |
|
---|
5 |
|
---|
6 | class anon2 {
|
---|
7 |
|
---|
8 | int count = 34;
|
---|
9 | int field;
|
---|
10 |
|
---|
11 | anon2 () { System.out.println ("anon2()"); }
|
---|
12 |
|
---|
13 | anon2 (foobar x) {
|
---|
14 | System.out.println ("Yikes!"+x.zoink());
|
---|
15 | }
|
---|
16 |
|
---|
17 | anon2 foo () {
|
---|
18 | class y extends anon2 {
|
---|
19 | int count = 3;
|
---|
20 | public void setCount (int j) { count = j; }
|
---|
21 | public int getCount () { return count+1; }
|
---|
22 | y (int i) { System.out.println ("y(int)"); }
|
---|
23 | }
|
---|
24 | return new y (3);
|
---|
25 | }
|
---|
26 |
|
---|
27 | anon2 bar () {
|
---|
28 | foobar xyz = new foobar ();
|
---|
29 | return new anon2 (xyz) {
|
---|
30 | int count = 5;
|
---|
31 | public void setCount (int j) { field = 3; count = j; }
|
---|
32 | public int getCount () { return count+1; }
|
---|
33 | } ;
|
---|
34 | }
|
---|
35 |
|
---|
36 | void test () {
|
---|
37 | anon2 b = bar ();
|
---|
38 | anon2 c = foo ();
|
---|
39 | }
|
---|
40 |
|
---|
41 | public static void main (String[] arg)
|
---|
42 | {
|
---|
43 | System.out.println ("Testing class `anon2'...");
|
---|
44 | new anon2 ().test ();
|
---|
45 | }
|
---|
46 | }
|
---|
47 |
|
---|
48 | class foobar {
|
---|
49 | public String zoink() { return " zoinked"; }
|
---|
50 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.