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

How many bits are in a sentence?

683


give an example for encapsulation?

660


What is constant in programming?

653


What is a constructor overloading in java?

612


Can we overload run() method in java?

695






Are registers volatile?

630


What is the method to expand and collapse nodes in a jtree?

701


What is the argument in java?

591


Why multiple inheritance is not supported by java?

604


What is size_t?

600


What is mutable object and immutable object?

736


What is local class in java?

634


What are the different types of garbage collectors in java?

651


Does java support Operator Overloading?

692


What are recursive functions?

681