Why aren't classes sealed by default?

前端 未结 9 1761
天命终不由人
天命终不由人 2020-12-05 22:59

I was just wondering, since the sealed keyword\'s existence indicates that it\'s the class author\'s decision as to whether other classes are allowed to inh

9条回答
  •  我在风中等你
    2020-12-06 00:00

    80% of the features of Word go unused. 80% of classes don't get inherited from. In both cases, once in a while, someone comes along and wants to use or reuse a feature. Why should the original designer prohibit reuse? Let the reuser decide what they want to reuse.

提交回复
热议问题