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 difference between next () and nextline () in java?
What is java volatile?
What is ternary operator? Give an example.
What is method and methodology?
Where are local variables stored?
Does sprintf allocate memory?
Why can we not override static method?
What is the maximum size of byte array in java?
What is the difference between the final method and abstract method?
Differece between class and generic class?
What is a function in programming?
How do you take thread dump in java?
What is vector capacity in java?
What is the function of http?
What is final keyword in java?