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
Why charat is used in java?
What is difference between overloading and overriding in java?
What are the loops in java?
What are abstract classes and anonymous classes?
'A class is a template for an object' explain this statement.
How can you avoid serialization in child class if the base class is implementing the serializable interface?
Does list maintain insertion order java?
What is a text string?
How do you define a singleton class?
What are serialization and deserialization?
Define an applet in java?
What is callablestatement? How you can call stored procedure to pass in parameter?
What is method overloading in java ?
What does void * mean?
What is sortedset in java?