publicclass MainClass {
public A cont() {
returnnew A() {
privateint i = 11;
publicint value() {
return i;
}
}; // Semicolon required in this case
}
publicstaticvoid main(String[] args) {
MainClass p = new MainClass();
A c = p.cont();
}
}
interface A {
int value();
}