The following code give me error that
Error 2 The type 'Series.AB' already contains a definition for 'B'
interface IA
{
void A();
}
interface IB
{
void B();
}
interface IAB : IA, IB
{
void A();
void B();
}
class AB : IAB
{
IA A;
IB B;
public AB(IA _a, IB _b)
{
A = _a;
B = _b;
}
public void A()
{
throw new NotImplementedException();
}
public void B()
{
throw new NotImplementedException();
}
}
I thought that I can use AB class instance as
IA A = new AB(); Or IB B = new AB(); Or IAB ab = new AB();
i am not able to understand what happen here. please anyone describe why this exception occurs.