can you create interface instance ?

Answer Posted / deepesh

Hi Uday.

Actually, in your problem, a reference of anonymous
inherently assigned to interface. In program, you no where
wrong, but instance of interface were not created, it
simply assigning the reference of anonymous class to
interface.. That is possible.

any way.. We can't create instance of interface.. In that
example only reference assignment to interface by anonymous
class.
Hope everybody can understand.

Is This Answer Correct ?    30 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sizeof () operator?

768


What is a constructor overloading in java?

787


Why for each loop is used?

782


What is java thread dump, how can we get java thread dump of a program?

800


What is difference between length and length() method in java ?

785


What is java Applet?

847


What do you mean by thread safe?

787


Why convert an applet to an application?

893


Why string is immutable or final in java

874


Difference between ‘is-a’ and ‘has-a’ relationship in java?

799


What is the file extension for java?

864


What is a function argument in java?

786


What do you mean by stack?

904


Can we override constructors in java?

891


Explain the differences between static and dynamic variables?

887