Interface
An interface defines a protocol. Classes or structures that implement interfaces must comply with their agreements. The statement takes the following form:
[Attributes] [Modifiers]Interface Identifier[:Base-list]{Interface-body}[;]
Where:
-
-
Attributes(Optional)
-
-
Additional declarative information. For more information about attributes and attribute classes, see .
-
-
Modifiers(Optional)
-
-
The allowed modifiers include new and four access modifiers.
-
-
Identifier
-
-
Interface Name.
-
-
Base-list(Optional)
-
-
Contains a list of one or more explicit basic interfaces separated by commas.
-
-
Interface-body
-
-
Declaration of interface members.
Public interface idinterface
{
Dataset getmanytable (string [] selectsql, string [] tablename );
Void excutesqlcommand (string sqlcommandstring );
}
Public class classdata: idinterface
{
Public dataset getmanytable (string [] selectsql, string [] tablename)
{
................
// Skip the intermediate implementation process
..........
}
Public void excutesqlcommand (string strsqlcmd)
{
// Skip the intermediate implementation process
}
}