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 a class be declared as protected?
What are the data types supported by java? What is autoboxing and unboxing?
Explain about version control?
How do you bind variables?
What is the range of the short type?
What is the final class modifier?
What are design patterns and please explain?
Explain parallel processing in java8?
Can we initialize the final blank variable?
How can we create an immutable class in java?
What are generic methods?
How do you sort a string in alphabetical order in java?
What is the difference between state-based unit testing and interaction-based unit testing?
What are the differences between graph and tree?
How do you sort arraylist in descending order?