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

Can a class be declared as protected?

752


What are the data types supported by java? What is autoboxing and unboxing?

768


Explain about version control?

777


How do you bind variables?

776


What is the range of the short type?

787


What is the final class modifier?

767


What are design patterns and please explain?

835


Explain parallel processing in java8?

901


Can we initialize the final blank variable?

823


How can we create an immutable class in java?

811


What are generic methods?

735


How do you sort a string in alphabetical order in java?

746


What is the difference between state-based unit testing and interaction-based unit testing?

725


What are the differences between graph and tree?

875


How do you sort arraylist in descending order?

790