using System;
public interface A{
void Add();
}
public interface B{
public abstract class C{
public void Sub()
{
Console.WriteLine("Non Abstract Method C");
public abstract void Add();
/*
A class inherits abstract base class C and implements 2 Interface A and B.
All have a method Add.If we create an object of this class and call Add method ,then overridden method will be called.
If we want to call interface implementation then we can use interface reference and call method.
Also its not mandatory to implement interface in this situation.
*/
public class D:C,A,B
public override void Add()
Console.WriteLine("Abstract Add");
/* void A.Add()
Console.WriteLine("Interface A");
void B.Add()
Console.WriteLine("Interface B");
}*/
public class Program
public static void Main()
D obj=new D();
A a=obj;
a.Add();
B b=obj;
b.Add();
obj.Sub();
obj.Add();