Why seal a class?

前端 未结 10 1934
醉酒成梦
醉酒成梦 2020-11-28 04:51

I\'d like to hear what is the motivation behind the bulk of sealed classes in the .Net framework. What is the benefit of sealing a class? I cannot fathom how not allowing in

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 05:35

    Sealed is used to prevent the "brittle base class problem". I found a good article in MSDN that explains that.

提交回复
热议问题