Skip to content

Instantly share code, notes, and snippets.

@Aravin
Last active April 12, 2018 18:44
Show Gist options
  • Save Aravin/bb6280886d2a0886426d8f09e47c8ec0 to your computer and use it in GitHub Desktop.
Save Aravin/bb6280886d2a0886426d8f09e47c8ec0 to your computer and use it in GitHub Desktop.
Private Protected Access Modifier in CSharp C#
// Code from Project 1
namespace FirstAssembly
{
public class FirstClass
{
private protected static void FirstMethod()
{
Console.WriteLine("Private protected method called...");
}
}
}
// Code from Project 2
using FirstAssembly;
namespace SecondAssembly
{
public class SecondClass : FirstClass
{
public static void SecondMethod()
{
FirstMethod(); // No access to the base class since it is private protected.
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment