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 does sprintf return?
Java is Pass by Value or Pass by Reference?
What is substring 1 in java?
What does flagged out mean?
What is the difference between super class & sub class?
Can we inherit a class with private constructor?
what is the difference between the methods sleep() and wait()? : Java thread
What is final class?
What is boolean false?
What is singleton pattern?
Explain about main() method in java ?
I want to persist data of objects for later use. What’s the best approach to do so?
What are user defined exceptions?
How do singleton patterns work?
Can we override compareto method?