can we create instance for interface in java?

Answer Posted / jyotisubhra ghosh

You can not instantiate an interface,however, u can create
its reference variabe.

You can just assign an object of a class (implementing the
interface) to the reference variable of the interface.

Is This Answer Correct ?    50 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are data structures in java?

757


What is jdbc api?

772


Difference between serialization and deserialization in java?

882


What is flush () in java?

794


What are streams?

871


How do you reverse a list?

793


What do you mean by collectors in java 8?

751


What are variable arguments or varargs?

809


Is there any way to skip finally block of exception even if some exception occurs in the exception block?

858


What is the difference between super class & sub class?

825


What is serialversionuid?

794


Which container method is used to cause a container to be laid out and redisplayed in java programming?

878


Is the milky way in a void?

774


What’s the difference between constructors and other methods?

777


What is the difference between call by reference and call by pointer?

742