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

make a method which any number and any type of argument and print sum of that arguments.....

1382


Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?

543


Why put method is used?

532


What is polymorphism in java? What are the kinds of polymorphism?

582


Which is bigger float or double?

518






Which is better 64 bit or 32 bit?

507


Why array is used in java?

517


What are the differences between path and classpath variables?

493


What interface is extended by awt event listeners?

595


What is internal variable?

540


How do you test a method for an exception using junit?

535


How do you define a set in java?

513


Is null a keyword in java?

557


Can we serialize static variables in java?

655


What methodology can be utilized to link to a database?

506