From the following code, interface is accepting creating new instance compiler is not giving any warning or error. Can anybody explain how it works. Any body help appreciated.
interface TestA {
String toString(); }
public class
Test {
public static void main(String[] args) {
System.out.println(new TestA() {
public String toString() { return "test"; }
});
}
}
-Mohan