Under what circumstances an object reference be cast to an
interface reference?
Answer Posted / 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 |
Post New Answer View All Answers
What is a class object?
Can a final variable be initialized in constructor?
What is nullpointerexception in java?
Can we override a variable in java?
What is a "pure virtual" member function?
Why are the objects immutable in java?
What is lambda expression in java?
List types of storage classes in java?
What are the concepts of 'OOPS'?
What methods are used in Servlet?Applet communication?
Can we call thread start () twice?
How do you compare objects in java?
What is locale in java?
What are "class access modifiers" in Java?
What does += mean in java?