overriding protected internal with protected!
- by Asad Butt
This is an extension for this question asked an hour ago.
We cannot modify the access modifiers, when overriding a virtual method in derived class. Consider Control class in System.Web.UI namespace
public class Control : IComponent, IDisposable,...
{
protected internal virtual void CreateChildControls()
{ }
.
.
}
Now Consider This
public class someClass : System.Web.UI.Control
{
// This should not compile but it does
protected override void CreateChildControls()
{ }
// This should compile but it does not
protected internal override void CreateChildControls()
{ }
}
can any body explain this ? Thanks