Under what circumstances an object reference be cast to an
interface reference?
Answers were Sorted based on User's Feedback
Answer / muthusenthil
when a class implements an interface then an object
referance of that class can be casted to interface referance
class A implements B{
public static void main(String args[]){
B b=new A();
}
| Is This Answer Correct ? | 6 Yes | 1 No |
Answer / janet
When the object implements the referenced interface, an
object reference be cast to an interface reference.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / debapriya maity
Exactly whenever ur entity passed the IS-A Test ,
A is B :)
| Is This Answer Correct ? | 1 Yes | 0 No |
Can a method be static?
Can an interface have a class?
What is meant by class and object in java?
What are annotations in java?
Can we sort hashmap in java?
what is polymorphism with example?types of polymorphism?
How do you use, call, and access a static method in Java?
how to handle a singleton service locator. when multiple threads are trying to get the singleton object in same time
What is public static?
How to implement Singleton
What's the access scope of protected access specifier?
What's the base class in java from which all classes are derived?