What is an interface class?

It is an abstract class with public abstract methods all of which must be implemented in the inherited classes.

Showing Answers 1 - 1 of 1 Answers

Ans:

Definition:

An Interface is a reference type and it contains only abstract members. Interface's members can be Events, Methods, Properties and Indexers. But the interface contains only declaration for its members.The interface can't contain constants, data fields, constructors, destructors and static members. All the member declarations inside interface are implicitly public. 

 

Example:

//an iterface syntax

interface <interfacename>{

//Some methods

}

//example

interface Drawable

{

void draw()

}

//implement in class

class circle:Drawable(inheritance)

public void draw()

{

System.Console.writeline("circle");

}

}

 

}

 

 

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions