What are the benefits to defining methods as protected
in C#?
like :
protected void KeyDemo_KeyPress( object sender, KeyPressEventArgs e )
{
// some code
}
As compared to something like this:
private void FormName_Click( object sender, EventArgs e )
{
//some code
}
I've seen such examples in many books and I don't understand why and when do they use private
vs protected
?