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
Can you sort a list in java?
What is the benefit of using enum to declare a constant?
What is the file extension for java?
Is java good for beginners?
How are variables stored?
which class is the wait() method defined in? : Java thread
What is JVM and is it platform independent?
What language is java written?
What does the @override annotation do?
How are the elements of a gridbaglayout organized in java programming?
What is sortedset in java?
What are different data structures in java?
If a method is declared as protected, where may the method be accessed?
How to invoke external process in java.
What are the main uses of this keyword?