Can we instantiate Interfaces?

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


Please Help Members By Posting Answers For Below Questions

What is a nested structure?

541


What is the difference between path and classpath variables?

533


Tell me the latest versions in java related areas?

587


How do you compare two strings lexicographically?

545


What is the gregoriancalendar class in java programming?

574






What are peerless components?

626


What is composition in java?

730


What is array size in java?

502


What do you meant by active and passive objects?

613


Can we define static methods inside interface?

531


Which programming language is most secure?

537


Is singleton set an interval?

536


What are the steps involved to create a bean?

685


What is the major advantage of external iteration over internal iteration?

617


What do you understand by private, protected and public?

526