can we create a instance for intwerface?

Answer Posted / subhash

No.We cannot create instance for interface.But we can
create reference to an interface.We can implement the
interface by creating sub class(implementation class) and
creat instance to the sub class, then you can create
reference to the interface by assigning instance of sub
class to the interface reference variable.

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between runnable and callable interface in java?

586


Can you call one constructor from another if a class has multiple constructors?

586


What are the different types of collections in java?

526


What is meant by singleton class?

600


What does a za z0 9 mean?

562






What is immutable class in java?

511


what is function overloading in java?

697


How to declare an arraylist in java?

482


What are namespaces in java?

525


What is meant by object oriented programming – oop?

543


What are conditionals and its types?

587


What is hashmap in java?

566


Give a brief description of java socket programming?

526


What do you mean by formatting?

545


What is argument in java?

538