Initial revision

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@899 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 25 years ago
parent d35c590644
commit 584b7579ff
  1. 22
      jode/test/InlinedAnon.java
  2. 18
      jode/test/NestedAnon.java

@ -0,0 +1,22 @@
package jode.test;
public class InlinedAnon {
private final Object getAnon(final int param) {
return new Object() {
public String toString() {
return ""+param;
}
};
}
void test1() {
Object o1 = getAnon(5);
Object o2 = getAnon(3);
}
void test2() {
Object o3 = getAnon(1);
Object o4 = getAnon(2);
}
}

@ -0,0 +1,18 @@
package jode.test;
public class NestedAnon {
public NestedAnon(int maxdepth) {
class NestMyself {
int depth;
NestMyself son;
public NestMyself(int d) {
depth = d;
if (d > 0)
son = new NestMyself(d-1);
}
}
new NestMyself(maxdepth);
}
}
Loading…
Cancel
Save