Under what circumstances an object reference be cast to an
interface reference?

Answers were Sorted based on User's Feedback



Under what circumstances an object reference be cast to an interface reference?..

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

Under what circumstances an object reference be cast to an interface reference?..

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

Under what circumstances an object reference be cast to an interface reference?..

Answer / debapriya maity

Exactly whenever ur entity passed the IS-A Test ,

A is B :)

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is the is a and has a relation ship in oops concept in java?

9 Answers   BearingPoint, TCS,


What is bool mean?

0 Answers  


What is the use join() in Threads ?

5 Answers   HCL,


What's the base class of all exception classes?

0 Answers  


What is palindrome in java?

0 Answers  






What is mean by encoding?

0 Answers  


where do you place after you did code in java

2 Answers  


What is identifier with example?

0 Answers  


What is a default package ?

7 Answers  


What are the types of web technologies?

0 Answers  


Which are different kinds of source code?

0 Answers  


what is singlton class?where it is use in real time senario.

1 Answers   Wipro,


Categories