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
What is the function of log?
What is an argument in java?
What are the four corner stones of oop?
Can we override private methods?
Can we use different return types for methods when overridden?
How do you make an arraylist empty in java?
How to change value in arraylist java?
What the difference is between execute, execute Query, execute Update?
Which data type is class in java?
Explain about the dynamic behavior of core java?
What are the basic control structures?
What is jdbc api?
What is off heap memory?
What is strings in java?
What are the restrictions imposed by a Security Manager on Applets?.