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

Which collection is best for sorting in java?

692


how do I create a runnable with inheritance? : Java thread

505


What is the purpose class.forname method?

556


What is the exception hierarchy in java?

481


What is java dot?

490






What is cr keyboard?

650


Does treeset allow null in java?

506


Is string pool garbage collected?

545


How do you decide when to use arraylist and linkedlist?

530


What is the static variable?

571


How we can run a jar file through command prompt in java?

516


What is the difference between abstraction and encapsulation?

559


What is console based application in java?

540


What is downcasting?

567


What is the largest long allowed by java?

532