What is Interface in C# and how to use it?
An Interface in C# is a contract between Interface and class that implements it. This contract says any class that implements this interface will provide the implementation for the members of the Interface. Unlike, Abstract class, Interface in C# can only contain declaration not implementation. Because all the members of the Interface are abstract and cannot have an implementation. The keyword abstract will not be used with the members of the Interfaces but the compiler will treat them as abstract members.
Just like Abstract and other special classes, Interfaces also come with some rules. Lets discuss those rules now.
|
|
Full Story |
This topic does not have any threads posted yet!
You cannot post until you login.