A protected method of a class will be accessible in any inherited class. But it is not accessible outside of class, even by using same class name.
using System;
public partial class _Default : System.Web.UI.Page
{
class aaa
{
protected void abc()
{
int i = 1;
}
}
class bbb: aaa
{
public void g()
{
abc();
}
}
class ccc : bbb
{
public void h()
{
abc();
}
}
protected void Page_Load(object sender, EventArgs e)
{
ccc c = new ccc();
c.g();
//not working
//c.abc();
}
}
