Relates :
|
|
Relates :
|
Let's consider following code: interface I {} class Test { void foo() { new Object() { I bar() { return (I)this; } }; } } This code compiles successfully by javac from JDK build 128. However compilation should fail on 'return (I)this;' because the anonymous class doesn't have any relation to interface I.
|