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 are the differences between heap and stack memory in java?
Explain the importance of throwable class and its methods?
What is immutable class in java?
Which java version is latest?
How to create com object in Java?
What is the difference between replace and replace all?
What is set in java?
Why java is not 100% object-oriented?
Are variables stored in ram?
Can we declare an interface as final?
How to add menushortcut to menu item?
What is a singleton class in Java?
What is the reason behind using constructors and destructors?
What is the independent variable in an experiment?
What is treeset in java?