An interface is a contract. If you are defining an interface, then you are describing a set of rules. A class can follow the rules specified by the interface. When a class fulfills the contract or rules specified by the interface, we could say that a class implements the interface.
Interfaces in C# provide
a way to achieve runtime polymorphism. Using interfaces we can invoke
functions from different classes through the same interface
reference, whereas using virtual functions we can invoke functions
from different classes in the same inheritance hierarchy through the
same reference.
Public interface
<interface name>
{
//specify the contract
}
An interface looks like a
class, but has no implementation. The only thing it contains are
declarations of events, indexers, methods, and /or properties. The
reason interfaces only provide declarations is that they are
inherited by classes and structs, which must provide an
implementation for each interface member declared.
If you are interested to
learn more OOPS concepts and their application in .NET, you can join
SLA IT Employment Training Company. For
more details visit SLA Jobs T Nagar Chennai
or dial (91
44) 4200 5050/90.
Wonderful post! Thanks for sharing.
ReplyDeletePlacement Training in Chennai
Training institutes in Chennai with Placement
Best Training and Placement institutes in Chennai
Oracle DBA Training in Chennai
Tally Course in Chennai
WordPress Training Institute in Chennai
very nice post!!
ReplyDeleteAndroid Training in Chennai
Android Online Training in Chennai
Android Training in Bangalore
Android Training in Hyderabad
Android Training in Coimbatore
Android Training
Android Online Training