I came across very tricky situation about Implementing multiple interface having same Method name as Member.below is sample code for the problem.
public interface IBase1
{
void show();
}
public interface IBase2
{
void show();
}
public class BaseClass :IBase1, IBase2
{
void IBase1.show()
{
Console.WriteLine("IBase1.show()");
}
void IBase2.show()
{
Console.WriteLine("IBase2.show()");
}
}
Main Class
class Program
{
static void Main(string[] args)
{
BaseClass obj = new BaseClass();
//How to access IBase1.show() and IBase2.show()
}
}
Here I have two interface's with member as show() method in each and one class which is implementing this two interface, now my question is how to access this method of BaseClass
in Main function.