can you create interface instance ?
Answer Posted / bibhuti
i am bit confused with this one.
If it is referring to an anonymous class then if i am changing like below then why it is not working?
public static void main(String[] args) {
Object t = new TestOne() {
public void wish() {
System.out.println("output: hello how r u");
}
};
t.wish();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Does list maintain insertion order java?
What is array and arraylist in java?
How finally used under exception handling?
How does callback work in java?
How do you reverse sort a list in java?
What is string array?
What are the differences between forwarding () method and sendredirect() methods?
What does @override mean?
When should I use singleton?
What is a protected void?
What does singleton mean in java?
What does || mean in code?
Is array a class in java?
In which language java is written?
Is singleton class immutable?