Have you ever seen design with reasonable usage of protected internal access modifier?

前端 未结 6 823
野的像风
野的像风 2021-02-13 04:01

I haven\'t, but I don\'t say there isn\'t one.

All of the C# developers who read this probably do know what is protected internal and when to use it. My question is simp

6条回答
  •  青春惊慌失措
    2021-02-13 04:43

    It's just to be mean to people who want to inherit from your type, because they don't work for the same company as you. ;-)

    Seriously, though, the question applies to internal alone ... we know why you'd use protected, right? So, why internal? Probably only when you know that your type accesses some resources that are only available within the same assembly. Whether that is an actual resource, or another type that you don't want to share with the world.

提交回复
热议问题