can you create interface instance ?
Answer Posted / shankar patil
You can't create an object without method implementations.
Anonymous inner classes allow you to do.
public interface MyInterface {
public void myMethod() ;
}
MyInterface myIntfObj = new MyInterface() {
public void myMethod() {
}
};
myIntfObj.myMethod();
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How do constructors use this() and super()?
What is java Applet?
If you do not want your class to be inherited by any other class. What would you do?
How many types of design patterns are there?
What does java ide mean?
What do you understand by the term string pool?
What initialize variables?
Is cout buffered?
What type of language is java?
What is the use of static class?
How is tree Mirroring implemented?
How do you do a line break in java?
What are nested classes in java?
Differentiate between the constructors and methods in java?
Explain the concept of hashtables?