overriding protected internal with protected!

后端 未结 3 1570
逝去的感伤
逝去的感伤 2020-12-08 07:08

This is an extension for this question asked an hour ago.

We cannot modify the access modifiers, when overriding a virtual method

3条回答
  •  醉酒成梦
    2020-12-08 07:52

    Protected internal means protected OR internal. So if by overriding outside the original assembly you were allowed to mark it protected internal you would be allowing other classes in the same assembly as the overrider to call this method. That would effectively mean that original parent's internal encapsulation would be violated.

提交回复
热议问题