摘要:
以Animal类为例,假设要实现以下4种动物: Dog(狗)、Bat(蝙蝠)、Parrot(鹦鹉)和Ostrich(鸵鸟) 如果按照哺乳类和鸟类来区分的话,可以这样设计: Animal: |--Mammal |--Dog |--Bat |--Bird |--Parrot |--Ostrich 但是, 阅读全文
posted @ 2018-03-08 23:32
风雨一肩挑
阅读(612)
评论(0)
推荐(0)
|
摘要:
以Animal类为例,假设要实现以下4种动物: Dog(狗)、Bat(蝙蝠)、Parrot(鹦鹉)和Ostrich(鸵鸟) 如果按照哺乳类和鸟类来区分的话,可以这样设计: Animal: |--Mammal |--Dog |--Bat |--Bird |--Parrot |--Ostrich 但是, 阅读全文
posted @ 2018-03-08 23:32
风雨一肩挑
阅读(612)
评论(0)
推荐(0)
|