Query in C# Interface conceptHi Team,
I am learning programming skills and executing the following code
class intimplement : first, second
public void displayfirst()
Console.WriteLine("I am first interface");
public void displaysecond()
Console.WriteLine("I am second interface");
static void Main(string args)
intimplement assign = new intimplement();
first avalue = (first)assign;
second bvalue = (second)assign;
when I execute the above code I am getting the expected result as
I am first interface
I am second interface
However, if I remove public modifier from the class intimplement then I am getting following message
intimplement.displaysecond()' cannot implement an interface member because it is not public.
intimplement.displayfirst()' cannot implement an interface member because it is not public.
By default interface members are public so why should I declare the method as Public while implementing interface.
Please clarify. Thank you very much.