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 is the symbol for line break?

612


What is a local block?

643


What is meant by 'Class access modifiers'?

558


What’s meant by anonymous class?

606


Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?

581






How will you add panel to a frame?

651


Explain listiterator and methods in listiterator?

550


Define the term string pool?

590


What is java in simple terms?

566


How do you represent a space in regex java?

524


Explain the inheritance?

577


What is number data type in java?

560


What is meant by class loader? How many types are there?

678


What happens to a static var that is defined within a method of a class?

552


Is it possible to cast an int value into a byte variable? What would happen if the value of int is larger than byte?

551