Python Basics - Object Oriented Programming

classes and objects

2 very important concepts of object oriented programming: classes and objects

Objects are the core of object-oriented programming. In the process of using objects, in order to abstractly define a group of objects with common characteristics and behaviors, another new concept - class is proposed.

A class is equivalent to a drawing when manufacturing an airplane, and an airplane created with it is equivalent to an object

1. Class

人以类聚 物以群分。
具有相似内部状态和运动规律的实体的集合(或统称、抽象)。 
具有相同属性和行为事物的统称

The class is abstract, and when it is used, it usually finds a concrete existence of this class and uses this concrete existence. A class can find multiple objects

 

 

 

2. Object

某一个具体事物的存在 ,在现实世界中可以是看得见摸得着的。

可以是直接使用的

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325135533&siteId=291194637