what is the use of interfaces..??
what is the use of interface...???
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bikesh SrivastavaPosted Nov 27, 2016, 6:50 AM
Ramesh SPosted Nov 25, 2016, 8:18 AM
Nitin SontakkePosted Nov 25, 2016, 6:35 AM
Santhosh KumarPosted Nov 25, 2016, 6:10 AM
First and foremost, interfaces in C# are a means to get around the lack of multiple inheritance in C#, meaning you cannot inherit from multiple classes but you can implement multiple interfaces. OOP tries to resemble how objects are defined in the real life, and interfaces are a very logical way of grouping objects in terms of behavior.
An interface is a contract between itself and any class that implements it. This contract states that any class that implements the interface will implement the interface's properties, methods and/or events. An interface contains no implementation, only the signatures of the functionality the interface provides. An interface can contain signatures of methods, properties, indexers & events.
You can think of an interface as an abstract class with the implementation stripped out. An interface doesn't actually do anything, like a class or abstract class, it merely defines what a class that implements it will do. An interface can also inherit/implement other interfaces.