Why interface cannot have static methods in C#

  • Thread starter Thread starter PadmasekharP
  • Start date Start date
P

PadmasekharP

Guest
Can anyone please help me to know why interface in C# cannot have static methods.

I have tried like this then I got compile time error saying "The modifier static is not a valid for this item".

public interface InterfacesEx
{
static string Test();
}

Can anyone help me to know why static is not valid in interfaces.

Continue reading...
 
Back
Top