did interface can implementation method ? i know its not
possible but my interviewer said its possible ..but how..?
any one have idea ???

Answer Posted / prabhu prasad

Hi Laxmidhar,

In your program you declare a reference variable, o1, of type interface A. Then you declare a new class that
has no name (means a anonymous class). Though A is an interface so the anonymous class actually implementing interface A…

If A is a class instead of interface then the anonymous class would be the subclass of A..

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the function of log?

731


What is an argument in java?

701


What are the four corner stones of oop?

782


Can we override private methods?

766


Can we use different return types for methods when overridden?

770


How do you make an arraylist empty in java?

697


How to change value in arraylist java?

757


What the difference is between execute, execute Query, execute Update?

587


Which data type is class in java?

775


Explain about the dynamic behavior of core java?

866


What are the basic control structures?

729


What is jdbc api?

755


What is off heap memory?

744


What is strings in java?

801


What are the restrictions imposed by a Security Manager on Applets?.

2311