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 strings in java?

582


What is primitive data type in java?

537


What are the advantages of inner classes?

505


if u open login & logout ,how can udisplay the timelogin & logout members ?

1748


How is java hashmap implemented?

542






Can a static member function access member variable of an object?

554


What are the 8 data types in java?

517


What do you mean by synchronized non access modifier?

560


What is difference between arraylist and list in java?

576


How list contains works in java?

550


Is sizeof a keyword in java programming?

599


In a class implementing an interface, can we change the value of any variable defined in the interface?

553


Can a class with private constructor be extended?

482


What are the differences between string, stringbuffer and stringbuilder?

513


What is the difference between inner class and nested class?

548