I have two interfaces with same method
interface FirstInterface
{
int add(int x, int y);
}
interface SecondInterface
{
int add(int x, int y);
}
class TestInterface:FirstInterface,SecondInterface
{
public TestInterface() {}
public int add(int x, int y)
{
return x + y;
}
}
and in my main class
static void Main(string[] args)
{
TestInterface t = new TestInterface();
int result = t.add(3, 4);
}
The compiler doesnt give any error and the result is displayed..
Is it right ?? shouldn't we use FirstInterface.add ??
does it mean interfaces are resolved at compile time ??