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

A abstract class extending an abstract class.Super class has both abstract and non-abstract methods.How can we implement abstract and non-abstract mehtods? Explain with snippet

3 Answers  


What is a layout manager and what are different types of layout managers available in java awt?

0 Answers  


what is difference between global methods and local methods?

1 Answers  


Why map is used in java?

0 Answers  


Is node a data type in java?

0 Answers  






Difference between a Scrollbar and a ScrollPane?

1 Answers  


What is abstraction in java?

0 Answers   Akamai Technologies,


Can a boolean be null java?

0 Answers  


What is difference between path and classpath variables?

0 Answers  


When is the arraystoreexception thrown?

0 Answers  


Can a class extend more than one class?

0 Answers  


Difference between array and arraylist.

23 Answers   Arise Solution, Banca Sella, iFocus, NIC, Sai Softech, Solartis, TCS, Verizon,


Categories