can you create interface instance ?
Answer Posted / anthony
cool buddy. Nice way to fool people.
If you really need to check the concept, put the code in
eclipse or netbeans and see. The method in the anonymous
class would show as overriden from interface Test and if
you remove the method from the anonymous class, it would
not compile. So at the end you are having an instance of
class implementing the interface.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the purpose of sizeof operator?
When will we use them?
What is difference between classpath and path variables in java?
How is hashset defined in java?
How do you escape in java?
Enlist diffrent types of inheritance supported by java?
What is navigable map in java?
What is hashing principle in java?
How can we access some class in another class in java?
How does thread synchronization occurs inside a monitor?
How is it possible for two string objects with identical values not to be equal under the == operator?
Is arraylist ordered?
What is scanner in java?
What is finally block?
Can constructor return value?