Interfaces
- Interface-Based Programming
An interface only defines a signature of properties and methods(method name, type of each parameter, type of return value).1
2
3
4
5
6
7
8
9
10interface IMyInterface
{
int property1
{
get;
set;
}
void Method1();
void Method2();
}
A class is used to implement the interface by providing the actual code for those methods.
- Interface Name Form
Microsoft dictates that all interface names start with theI
characters, that they not include underscore character, and that they use Pascal casing when the name contains mutiple words(first letter of each word is uppercase).
Post Date: 2018-10-18
版权声明: 本文为原创文章,转载请注明出处