المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How can i know from which interface the method is calling?



C# Programming
03-27-2010, 07:30 PM
namespace MYConsoleApplication
{
class Program
{
static void Main(string[] args)
{

int x = 3;
int y = 2;

x= (x==y++)?x+y:x-y;

A ObjA = new A();
ObjA.M1();
}
}

interface Inf1
{
void M1();
void M2();
}

interface Inf2
{
void M1();
}

class A: Inf1,Inf2
{
public void M1()
{
Console.Write("test");
}

public void M2()
{
Console.Write("test2");
}
}
}

From the above code ..how can i know from which interface the method M1() is overriding in Class A. Please let me know..if this is the case where tow interfaces contains same method..
G. Satish