abstract class Test { void foo() { } } class Test2 extends Test { { new Object() { void foo() { Test2.this.foo(); } }; } }