You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
345 B
22 lines
345 B
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);
|
|
}
|
|
}
|
|
|