mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-28 11:55:21 +08:00
5170877a05
2000-01-19 Alexandre Petit-Bianco <apbianco@cygnus.com> * libjava.lang/anon.java, libjava.lang/anon2.java, libjava.lang/anon3.java, libjava.lang/anon4.java, libjava.lang/direct_read.java, libjava.lang/direct_write.java, libjava.lang/indirect.java, libjava.lang/indirect_read.java, libjava.lang/indirect_write.java, libjava.lang/inner1.java, libjava.lang/inner2.java, libjava.lang/inner3.java, libjava.lang/inner4.java, libjava.lang/inner_array.java, libjava.lang/multiple_finit.java, libjava.lang/private_direct_read.java, libjava.lang/private_direct_write.java, libjava.lang/private_indirect_read.java, libjava.lang/private_indirect_write.java, libjava.lang/search_outer.java, libjava.lang/tmi.java, libjava.lang/tp.java, libjava.lang/update_outer.java: New files. From-SVN: r31511
53 lines
1.1 KiB
Java
53 lines
1.1 KiB
Java
// Class anon
|
|
// Generated on Wed Dec 29 10:07:09 PST 1999
|
|
//
|
|
|
|
|
|
interface itf {int count = 0;void setCount (int i);int getCount ();}
|
|
|
|
class anon {
|
|
|
|
int count = 34;
|
|
|
|
class x implements itf {
|
|
int count = 3;
|
|
public void setCount (int j) { }
|
|
public int getCount () { return count*3; }
|
|
}
|
|
|
|
|
|
itf foo () {
|
|
class y implements itf {
|
|
int count = 3;
|
|
public void setCount (int j) { count = j; }
|
|
public int getCount () { return count+1; }
|
|
}
|
|
return new y ();
|
|
}
|
|
|
|
itf bar () {
|
|
return new itf () {
|
|
// The class defined right here will implement `itf'
|
|
int count = 5;
|
|
public void setCount (int j) { count = j; }
|
|
public int getCount () { return count+1; }
|
|
} ;
|
|
}
|
|
|
|
void test () {
|
|
itf a = foo ();
|
|
itf b = bar ();
|
|
x c = this.new x ();
|
|
System.out.println (a.getCount ());
|
|
System.out.println (b.getCount ());
|
|
System.out.println (c.getCount ());
|
|
System.out.println (this.count);
|
|
}
|
|
|
|
public static void main (String[] arg)
|
|
{
|
|
System.out.println ("Testing class `anon'...");
|
|
new anon ().test ();
|
|
}
|
|
}
|