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
Will the compiler creates a default constructor if I have a parameterized constructor in the class?
What is a values collection view ?
Name few java util classes introduced with java 8 ?
Why is it called a string?
Is treeset sorted in java?
Define reflection.
What is pass by value?
What is a parameter in simple terms?
What is stringreader?
What does replaceall do in java?
How can you say java is object oriented?
Why java is not 100% object-oriented?
What does compareto () do in java?
Define packages in java?
What is method reference?