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

What is this keyword in java?

792


Assume a thread has lock on it, calling sleep() method on that thread will release the lock?

874


What are the important features of Java 11 release?

785


What is the difference between the ">>" and " >>>" operators in java?

731


Explain about doubly linked list

829


What do you mean by object?

724


What is the final access modifier in java?

818


How to call one constructor from the other constructor ?

808


Why is whitespace important?

776


What is the use of keywords in java?

765


Can you pass functions in java?

780


What is called module?

764


How do I enable java in safari?

768


How to declare an arraylist in java?

693


Is java ee a framework?

726