Interface Implementation

Interfaces can be implemented by using classes and structs. The interface name is specified in the base class list of the implementing class or struct.

Explicit Interface Member Implementation

The term explicit interface member implementation refers to a method, property, event, or indexer declaration that references a fully qualified interface member name. This is shown in the following example:

using System; 
interface Inter1 
{
    void Method1(); 
} 
interface Inter2 
{
    void Method2(); 
} 
class Class1: Inter1, Inter2 
{
    void Inter1.Method1() 
    {
        //Implementation code 
    } 
    void Inter2.Method2() 
    {
        //Implementation code 
    } 
}

Here, Inter1.Method1() and Inter2.Method2() are explicit interface member implementations.

One important point ...

Get Special Edition Using C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.