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
Why java is considered dynamic?
Difference between Preemptive scheduling vs. Time slicing?
What are the 2 types of java programs?
What is ‘has a’’ relationship in java?
If a variable is declared as private, where may the variable be accessed?
Is arraylist dynamic in java?
Explain static nested classes ?
What is the purpose of the file class in java programming?
How to invoke external process in java.
What is anagram word?
What is a class variable?
Explain the importance of finalize() method.
Is string a data type in java?
What is the java project architecture?
What is a parameter in a function?