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 a class in java?
what is anonymous class in java?
Does string is thread-safe in java?
Does collectionutils isempty check for null?
How is the marker interface used in Java?
Why synchronization is important in java?
What is the main purpose of serialization in java?
What is the use of singleton?
what is the purpose of the runtime class?
What is runtime polymorphism or dynamic method dispatch?
What is a instance variable in java?
Can we increase size of array?
What does java edition mean?
What is appletviewer?
When should we create our own custom exception classes?