类与对象的关系(Relationship between class and object)

类是一种抽象的数据类型,它是对某一类事物的整体描述/定义,但是并不能代表某一个具体的事物

  动物、植物、手机、电脑

  Perosn类、Pet类、Car类等,这些都是用来描述/定义某一类具体的事物应该具备的特点和行为

对象是抽象概念的具体实例

  张三就是人的一个具体实例,张三家里的旺财就是狗的具体实例。

  能够体现出特点,展现出功能的是具体的实例,而不是一个抽象的概念。

————————

< strong > class is an abstract data type. It is the overall description / definition of a certain kind of things, but it cannot represent a specific thing < / strong >

Animals, plants, mobile phones, computers

Perosn class, pet class, car class, etc. These are used to describe / define the characteristics and behavior of a specific thing

< strong > objects are concrete instances of abstract concepts < / strong >

< strong > < / strong > Zhang San is a specific example of people, and Wang CAI in Zhang San’s family is a specific example of dogs.

It is a concrete instance rather than an abstract concept that can reflect the characteristics and functions.