Declaring the member functions of the interface in C# −
public interface InterfaceName { // interface members void InterfaceMemberOne(); double InterfaceMembeTwo(); void InterfaceMemberThree() } public class ClassName: InterfaceName { void InterfaceMemberOne() { // interface member } }
Above we see that our interface members are −
void InterfaceMemberOne(); double InterfaceMembeTwo(); void InterfaceMemberThree()
We will later in class Use it to implement the interface−
public class ClassName: InterfaceName { void InterfaceMemberOne() { // interface member } }
The above is the detailed content of How to declare member functions in C# interface?. For more information, please follow other related articles on the PHP Chinese website!