Interface basically used for Design Pattern. Interface can have Property,method,Events and Indexer.We can not define function body. and Implement derived class.Interface support multiple Inheritance.interface can not inherit class but class can inherit interface.
Interface is for ->create loosely coupled software ->support design by contract (an implementor must provide the entire interface) ->allow for pluggable software ->allow different objects to interact easily ->hide implementation details of classes from each other ->facilitate reuse of software
Basically Interface flexibility of the code. it is used like a Design Pattern. And you can implement Method, Properties, etc. in it. you can used it for multiple Inheritance to increase reusability but can't create object of that Interface.
One reason I use interfaces is because it increases the flexibility of the code
to make complex scenarios easier and code maintainability much easier. If you are a fan of SOLID principles then you will exactly know why interface rocks. :)
The major reason of using an Interface is that when we want to enforce some standards. In programming words, the class which will implements the interface must provide implementation of all functions/methods of an Interface. So, standard is imposed.
it restrict/enforce us to specific design that these are the specific properties that object will contain
interface is agrrement between itself and implmenetd clas in C# Multiple inheritance is not supoorted so we use interfaces
I use for speed purpouses, the JIT Compiler compile just one time if you are using several classes with the same interface.
for multiple inheritence
To achieve multiple inheritance we using interface in c#
If we want to access the other class without the creation of object. It is a reusable component
Simple answers is that ASP.NET is OOPS based ... So Multiple Inheritance no longer supported Thats why we should use "Interface"
Its work like as layer,same as a class. https://bikeshsrivastava.blogspot.in/2016/06/part-23what-is-interface-and-abstract.html
because using interface we can multiple inheritence
To achieve Loop coupling between module and achieve run time polymorphism.
Interfaces are more flexible than base classes because you can define a single implementation that can implement multiple interfaces.
http://dotnet-munesh.blogspot.in/2015/09/interface-in-c.html
to support multiple inheritance
Interface is a component directive to implement all properties.A class that implements an interface must implement all of the methods described in the interface. So many things can support loosely coupled along with interface.
Hide implementation, supports multiple inheritance and provide a agreement for all class that it inherit the interface that is "all class provide implementation of all functions/methods of an Interface"
to support multiple inheritance and to make loosely coupled software.
Hide implementation, supports multiple inheritance
We use interface for uncoupling the layer.