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
Are arrays immutable in java?
How do you identify independent and dependent variables?
What are the advantages of autoboxing?
Which variable is the independent variable?
Do extraneous variables affect validity?
What is procedure overloading?
Explain the usage of this with constructors?
What is public static?
What is exception handling in java?
Which is better arraylist or vector?
How do you compare characters in java?
What is the use of protected in java?
Which programming language is most secure?
Explain about anonymous inner classes in java?
Explain, java is compatible with all servers but not all browsers?