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 a method signature java?
Which programming language is most secure?
What are triggers in DB? Explain their types. How do they work?
Is singleton class immutable?
What are the advantages of encapsulation in java?
What is the nested interface?
What is a singleton class in Java?
What are accessor methods in java?
What is meant by inheritance and what are its advantages?
Is a boolean variable?
What is diamond operator in java?
Objects or references which of them gets garbage collected?
What are the steps involved to write rmi based programs?
What is Java Shutdown Hook?
Can we sort array in java?