R
Raj
While implementing multiple interfaces having same method name, in the
derived class without explicit implementation, if only one method is
implemented like the below way, whether the .NET CLR will refer to interface
one or two? Since this leads to ambiguity, why is the .NET CLR not throwing
any warning or error??
Code snippet for observation:
interface int1
{
void test()
}
interface int2
{
void test()
}
class Program:int1,int2
{
public void test()
{
Console.WriteLine("test");
}
pubic static void Main()
{
Program p=new Program();
p.test();
Console.Read();
}
}
Thank you
Regards
Raj
derived class without explicit implementation, if only one method is
implemented like the below way, whether the .NET CLR will refer to interface
one or two? Since this leads to ambiguity, why is the .NET CLR not throwing
any warning or error??
Code snippet for observation:
interface int1
{
void test()
}
interface int2
{
void test()
}
class Program:int1,int2
{
public void test()
{
Console.WriteLine("test");
}
pubic static void Main()
{
Program p=new Program();
p.test();
Console.Read();
}
}
Thank you
Regards
Raj