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
Does substring start with 0?
What are the methods used to implement for the key object in the hash map?
How is treeset implemented in java?
Why do we need singleton class?
What does += mean coding?
Explain the importance of thread scheduler in java?
How to make a non daemon thread as daemon?
What is a static class in java?
What is the difference between exception and error in java?
What is return data type?
What is array class in java?
Difference between association, composition and aggregation?
Can you extend singleton class?
What is parameter example?
How do you include a string in java?