Answer Posted / paletipatisrinu
No we can instantiate interface directly.but we can create
instantiate of interface in directly
interface i1
{
public void wish();
}
public class A implements i1
{
public static void main(string...arg)
{
i1 o1=new A();
o1.wish();
}
public void wish()
{
System.out.println("we can create instantiate in directly");
}
}
| Is This Answer Correct ? | 17 Yes | 1 No |
Post New Answer View All Answers
What is %d in printf?
What is a double vs float?
Can singleton class be cloned?
What is the use of static methods?
What is a boolean flag in java?
Can a static method be final?
What is the role of garbage collector in java?
How are the elements of a gridbaglayout organized in java programming?
What is object-oriented programming?
Can we use return in constructor?
Explain the inheritance?
What is the difference between abstraction and encapsulation?
Difference between object instantiation and construction ?
What is time complexity java?
Explain about serializable interface in java?