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
When super keyword is used?
What is navigable map in java?
What is pass by value?
How do you reverse sort a list in java?
What is difference between static and abstract class?
Difference between current previous versions of Java?
What is mnemonic code?
What does flag mean in java?
What is a module function?
What if I write static public void instead of public static void in java?
What are the limitations of procedural programming approach?
How to find the index of the largest number in an arraylist java?
What are the types of arrays in java?
How can you read an integer value from the keyword when the application is runtime in java? example?
What is a subsequence of a string?