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
Does treeset use compareto?
What are the four integer types supported by java?
What is role of void keyword in declaring functions?
Is char a data type in java?
What is java english?
Difference between method overloading and method overriding in java ?
Can we have a method name same as class name in java?
What is meant by design patterns?
What are advantages of exception handling in java?
what do you understand by the term string with respect to java?
What is variable and rules of variable?
What is the use of isempty in java?
What is method overriding in java ?
Write an algorithm for quick sort?
Can we have try block without catch block?