Can we instantiate Interfaces?

Answer Posted / bharat vandar

No we can instantiate interface directly.but we can create
instantiate of interface in directly,only class can create
an object of interface


interface x
{
public void abc();
}
class ac implements x
{
x at = new ac();

public void abc()
{
System.out.println("Bharat");
}
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When should the method invokelater() be used?

584


How many types of gc are there in java?

568


What are the legal operands of the instanceof operator?

566


Can the interface be final?

582


How do you sort a string in java?

541






What is thread count in java?

547


What are the escape sequences in java?

565


What is abstract class? Explain

597


Is cout buffered?

688


How to find the largest value from the given array.

528


How do you know if a value is nan?

568


What do you mean by scope of variable?

488


How long will it take to learn java?

509


What is integer valueof?

645


What is a java object and java application?

576