How to explain an object?

后端 未结 27 1761
广开言路
广开言路 2020-12-23 23:16

It\'s been years since I thought of this, but I am training some real juniors soon and need to explain what an object is to someone who doesn\'t know what it is.

B

27条回答
  •  没有蜡笔的小新
    2020-12-23 23:43

    I like the "Vehicle" example. Many things can be vehicles (abstract class), but they all have something in common - they can move from a to be at some speed. Then there can be different classes of vehicles: gound vehicles, some moving in water, some in the air.

    So you have another level of abstraction - all vehicles in the air for example need an altitude member.

    I guess you get the picture. This explains most of the points you've given above.

提交回复
热议问题