I have a doubt about how to call a specific interface method (Say IA or IB or In ...) in the following code. Please help me how to call. I commented out the lines of code where I declare the methods of the "public" interface, in which case it works. I don't know what to call it when I explicitly declare :( I am learning C # ....
interface IA
{
void Display();
}
interface IB
{
void Display();
}
class Model : IA, IB
{
void IA.Display()
{
Console.WriteLine("I am from A");
}
void IB.Display()
{
Console.WriteLine("I am from B");
}
static void Main()
{
Model m = new Model();
Console.ReadLine();
}
}
source
share