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

Can java list contain duplicates?

587


What is Applet Stub Interface ?

1978


Is void a type?

598


What is the function of java?

519


What value is a variable of the string type automatically initialized?

621






What is the use of arraylist in java?

538


What is a boolean flag in java?

575


What is compareto () in java?

550


Is sizeof a preprocessor?

555


What is string variable?

580


What are three advantages of using functions?

548


Can we define a package statement after the import statement in java?

590


What is the use of arrays tostring () in java?

526


How can we run a java program without making any object?

552


Explain what are final variable in java?

590