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


Please Help Members By Posting Answers For Below Questions

Why put method is used?

519


What is garbage collector?

616


How many decimal places is a double?

531


What does flag mean in java?

537


How does a cookie work in Servlets?

340






Is sizeof a preprocessor?

538


Explain about fail safe iterators in java?

559


What is difference overloading and overriding?

577


Do loops java?

544


Can each java object keep track of all the threads that want to exclusively access it?

528


Is main a keyword in java?

534


Which category the java thread do fall in?

563


If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?

588


What super () does in java?

480


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?

632