-2

In my C# assembly "Abc", I have the following class and static method:

internal class Xyz
{
    protected internal static void MakeAwesome()
    {
        ...       
    }
}

I noticed I can access this static method from anywhere in my assembly code. However, removing the "protected" from it seems to yield the same results:

internal class Xyz
{
    internal static void MakeAwesome()
    {
        ...       
    }
}

Is the "protected" here making no difference because it's a static method? Or is it restricting something I overlooked?

Ray
  • 7,940
  • 7
  • 58
  • 90

1 Answers1

0

protected means that it can also be accessed from derived classes.

In your case, since the class itself is internal, you cannot have derived classes outside the project, so it doesn't add anything to internal.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964