How to implement InterfaceImplementer.cs Interface in C #
Most people do not understand the knowledge points of this article "how to achieve InterfaceImplementer.cs interface in C#", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to achieve InterfaceImplementer.cs interface in C#" article.
Implementation API: InterfaceImplementer.cs instance
Using System
Interface IMyInterface
{
/ / API members
Void MethodToImplement ()
}
Class InterfaceImplementer: IMyInterface
{
Static void Main ()
{
InterfaceImplementer iImp = new InterfaceImplementer ()
IImp.MethodToImplement ()
}
Public void MethodToImplement ()
{
Console.WriteLine ("MethodToImplement () called.")
}
}
The InterfaceImplementer class implements the IMyInterface interface, and the implementation of the interface is similar to the inheritance syntax of the class:
Class InterfaceImplementer: IMyInterface
After inheriting the interface, we need to implement the interface's method MethodToImplement (), and the method name must match the method name defined by the interface.
The above is the content of this article on "how to implement InterfaceImplementer.cs Interface in C#". I believe we all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.