This article gives a basic idea on achieving an Explicit Interface implementation.
Introduction
This article gives a basic idea on how to achieve Explicit Interface implementation.
Background
The explicit interface implementation in OOPS states how to use same method name in multiple interfaces, how the implementation part of same method name should be carried out.
Using the code
In this article we used two interfaces iTeacher,iStudent which will have a Name method.
interface iTeacher
{
void Name();
}
interface iStudent
{
void Name();
}
class Program :iTeacher,iStudent
{
void iTeacher.Name()
{
Console.WriteLine("iteacher Interface Name Method");
}
void iStudent.Name()
{
Console.WriteLine("iStudent Interface Name Method");
}
static void Main(string[] args)
{
iStudent iS=new Program();
iS.Name();
iTeacher iT = new Program();
iT.Name();
Console.ReadKey();
}
}
Output

In the above code, two interfaces used a common method as
Name. The basic part of an interface is it must be implemented by a derived class in order to make use of an interface methods.