Under what circumstances an object reference be cast to an
interface reference?
Answers were Sorted based on User's Feedback
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 |
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 |
Answer / debapriya maity
Exactly whenever ur entity passed the IS-A Test ,
A is B :)
| Is This Answer Correct ? | 1 Yes | 0 No |
Is void a type?
Can an abstract class have a constructor?
what is thread in Java ?
How do you add an element to a set in java?
Is vector thread safe in java?
Explain creating threads by extending thread class ?
Explain oops concepts in detail?
How to print nodes of a Binary tree?
The following program is Overloading or Overriding? public class PolymorphismEx { public int sampleMethod(int a) { return a; } public String sampleMethod(int a) { return "Is it Overloading or Overriding???"; } }
4 Answers Ness Technologies, TCS,
What do you know about the garbate collector?
How many bits is a 64 bit byte?
Distinguish method overloading and overriding