Below is my code:
public interface I1
{
void method1();
}
public interface I2
{
void method1();
}
class MyClass
{
static void Main(string[] args)
{
One one = new One();
}
}
public class One :I1,I2
{
void I1.method1()
{
Console.WriteLine("This is method1 from Interface 1");
}
void I2.method1()
{
Console.WriteLine("This is method1 from Interface 2");
}
}
I have below issues:
- I am unable to declare methods as Public in class One as these are Interface methods.
- I am unable to call these Interface method implementations from MyClass instance in the Main function.