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
{
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).
近期评论