OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.lang/] [anon2.java] - Blame information for rev 772

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
// 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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.