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
Why put method is used?
What is garbage collector?
How many decimal places is a double?
What does flag mean in java?
How does a cookie work in Servlets?
Is sizeof a preprocessor?
Explain about fail safe iterators in java?
What is difference overloading and overriding?
Do loops java?
Can each java object keep track of all the threads that want to exclusively access it?
Is main a keyword in java?
Which category the java thread do fall in?
If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?
What super () does in java?
I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?