can you create interface instance ?

Answer Posted / shanmukha

Hi,
We can't create instance for an interface or abstract
class.Just remove the following code from the program
written by Uday.
interface Test
{
public void wish();
}
Remove the above code and run the program,then program will
compile and execute properly,because he used anonymous class.

Is This Answer Correct ?    11 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are examples of modifiers?

502


What modifiers may be used with an inner class that is a member of an outer class in java programming?

522


String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?

537


Can list have duplicates in java?

517


Where are register variables stored?

586






What is a singleton class? Give a practical example of its usage.

581


What is blank final variable?

557


Can a class be private or protected in java?

541


Why do we use bufferedreader?

524


What exceptions occur during serialization?

597


What is a function in programming?

545


Is assembly language a low level language?

488


What Is Query Throttling in java?

553


What is internal variable?

532


Describe the various concepts related to object oriented programming (oop).

578