Why aren't classes sealed by default?

前端 未结 9 1760
天命终不由人
天命终不由人 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-05 23:59

    For the same reason why objects are not private by default

    or

    to be consistent with the object analogue, which is objects are not private by default

    Just guessing, coz at the end of the day it's a language's design decision and what the creators say is the canon material.

提交回复
热议问题