Answer: interface is the
C# keyword which carries the signatures of
methods,
events,
properties etc. These can be used from the class or struct which implements that interface.
Example,
interface MyInterface
{
void MyMethod();
}
class MyClass : MyInterface
{
void MyInterface.Mymethod()
{
..........;
}
static void Main()
{
...........;
..........;
}
}
By using
interfaces, programs become more compact and very easier to maintain.
Asked In: Spotted While Learning |
Alert Moderator