Why are Super-class and Sub-class reversed?

后端 未结 7 2305
滥情空心
滥情空心 2021-02-12 12:29

In set theory, a set is a superset if it contains everything in the original set and possibly more. A subset however is does not contain everything of the initial set.

W

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-12 13:11

    A superclass defines a class that has a larger set of possible values as members. A subclass restricts the items that can be part of its class, so it defines a smaller set of possible members.

    The set of possible members of a superclass is a superset of the set of possible members of a subclass of that superclass.

提交回复
热议问题