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


Please Help Members By Posting Answers For Below Questions

who can i handle multiple client in RMI

1450


What is formatted output?

524


If goto and const is reserve words than why it is not work in java?

1513


What do you mean by append?

542


State some situations where exceptions may arise in java?

633






What is memory leak and how does java handle it?

529


can used Protected Class outside Function.?

618


How will you compute size of a structure?

594


What are Normalization Rules? Define Normalization?

558


What is method overloading with type promotion?

588


Why stringbuilder is not thread safe in java?

582


Why main method is static in java?

603


How does arraylist size increase in java?

535


What is fail fast in java?

580


What is a java applet? What is an interface?

637