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 access scope of a protected method?
What is a get method?
What is run time allocation?
How to call one constructor from the other constructor ?
can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread
How do you create a first line indent?
What is basic syntax?
Can you add null to a list java?
How garbage collection is done in java?
Can we define static methods inside interface?
What is binary tree in java?
What is valid keyword in java?
Can we have this () and super () together?
What is == mean?
Is java still relevant?