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
Java Compiler is stored in JDK, JRE or JVM?
Is list ordered in java?
How many characters is 2 bytes?
How many types of exception can occur in a java program?
What is :: operator in java?
What do you mean by order of precedence and associativity?
What is the difference between preemptive scheduling and time slicing in java programming?
Define iterator and methods in iterator?
what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent
Can we cast any other type to boolean type with type casting?
Is singleton thread safe in java?
Why bytecode is called bytecode?
What is the difference between a constructor and a method?
Is it possible to compare various strings with the help of == operator?
What does substring mean?