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
What is sizeof () operator?
What is a constructor overloading in java?
Why for each loop is used?
What is java thread dump, how can we get java thread dump of a program?
What is difference between length and length() method in java ?
What is java Applet?
What do you mean by thread safe?
Why convert an applet to an application?
Why string is immutable or final in java
Difference between ‘is-a’ and ‘has-a’ relationship in java?
What is the file extension for java?
What is a function argument in java?
What do you mean by stack?
Can we override constructors in java?
Explain the differences between static and dynamic variables?