|
|
|
@ -26,8 +26,10 @@ public class AnonymousJavac { |
|
|
|
|
int var = 3; |
|
|
|
|
|
|
|
|
|
public void test() { |
|
|
|
|
final long longVar = 5; |
|
|
|
|
final double dblVar = 3; |
|
|
|
|
class Hello { |
|
|
|
|
int var = 4; |
|
|
|
|
int var = (int) longVar; |
|
|
|
|
|
|
|
|
|
Hello() { |
|
|
|
|
System.err.println("construct"); |
|
|
|
@ -41,7 +43,7 @@ public class AnonymousJavac { |
|
|
|
|
Inner.this.hashCode(); |
|
|
|
|
Inner.this.var = var; |
|
|
|
|
AnonymousJavac.this.hashCode(); |
|
|
|
|
System.err.println("HelloWorld"); |
|
|
|
|
System.err.println("HelloWorld: "+dblVar); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
final Hello hi = new Hello(); |
|
|
|
@ -69,14 +71,19 @@ public class AnonymousJavac { |
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
Inner blub1 = new Inner("Inner param") { |
|
|
|
|
Hello hii = hi; |
|
|
|
|
|
|
|
|
|
public void test() { |
|
|
|
|
System.err.println("overwritten"); |
|
|
|
|
System.err.println("overwritten: "+hii+hi); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
Inner blub2 = new AnonymousJavac().new Inner("Inner param") { |
|
|
|
|
Hello hii = hi; |
|
|
|
|
|
|
|
|
|
public void test() { |
|
|
|
|
System.err.println("overwritten"); |
|
|
|
|
System.err.println("overwritten: "+hii); |
|
|
|
|
AnonymousJavac.this.hashCode(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -87,8 +94,9 @@ public class AnonymousJavac { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Vector v = new Vector(hi.var, var) { |
|
|
|
|
public String toString() { |
|
|
|
|
return super.toString(); |
|
|
|
|
Hello hii = hi; |
|
|
|
|
public Object clone() { |
|
|
|
|
return super.clone(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -99,4 +107,74 @@ public class AnonymousJavac { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void test() { |
|
|
|
|
class Hello { |
|
|
|
|
int var = 4; |
|
|
|
|
|
|
|
|
|
Hello() { |
|
|
|
|
System.err.println("construct"); |
|
|
|
|
} |
|
|
|
|
Hello(String info) { |
|
|
|
|
System.err.println("construct: "+info); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void hello() { |
|
|
|
|
this.hashCode(); |
|
|
|
|
AnonymousJavac.this.hashCode(); |
|
|
|
|
System.err.println("HelloWorld"); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
final Hello hi = new Hello(); |
|
|
|
|
final Hello ho = new Hello("ho"); |
|
|
|
|
final Object o = new Object() { |
|
|
|
|
int blah = 5; |
|
|
|
|
Hello hii = hi; |
|
|
|
|
|
|
|
|
|
public String toString() { |
|
|
|
|
this.hii.hello(); |
|
|
|
|
hi.hello(); |
|
|
|
|
return Integer.toHexString(AnonymousJavac.this.hashCode() |
|
|
|
|
+blah); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
Object p = new Object() { |
|
|
|
|
public String toString() { |
|
|
|
|
return o.toString(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
// Hello blah = new Hello("Hello World") {
|
|
|
|
|
// public void hello() {
|
|
|
|
|
// System.err.println("overwritten");
|
|
|
|
|
// }
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
Inner blub1 = new Inner("Inner param") { |
|
|
|
|
public void test() { |
|
|
|
|
System.err.println("overwritten"); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
Inner blub2 = new AnonymousJavac().new Inner("Inner param") { |
|
|
|
|
public void test() { |
|
|
|
|
System.err.println("overwritten"); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class Hi extends Inner { |
|
|
|
|
public Hi() { |
|
|
|
|
super("Hi World"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Vector v = new Vector(hi.var, new Inner("Hi").var) { |
|
|
|
|
public Object clone() { |
|
|
|
|
return super.clone(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
Hi hu = new Hi(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|