python中的oop_Python中的OOP概念-更多示例

python中的oop

As we have already discussed about the general concepts related to Class, Objects, Inheritance etc, using an example in the previous tutorial. In this tutorial, we will elaborate more on these topics.

正如我们已经使用上一教程中的示例讨论了与类,对象,继承等相关的一般概念一样。 在本教程中,我们将详细介绍这些主题。

对象 (Objects)

As already discussed in the previous tutorial, an object is a physical entity, whereas class is a logical defintion. An object can be anything like - a student while designing a school's record registry, or a pen in stationary's item management program, or a car in manufacture's car database program. There are three important characteristics by which it is identified, they are:

如上一教程中已讨论的,对象是物理实体,而类是逻辑定义。 对象可以是任何东西,例如,学生在设计学校的记录注册表时,或文具的物品管理程序中的笔,或制造商的汽车数据库程序中的汽车。 识别它的三个重要特征是:

  1. Identity: Identity refers to some piece of information that can be used to identify the object of a class. It can be the name of the student, the company name of the car, etc.

    身份 :身份是指可用于识别类对象的某些信息。 它可以是学生的姓名,汽车的公司名称等。

  2. Properties: The attributes of that object are called properties. Like age, gender, DOB for a student; or type of engine, number of gears for a car.

    属性 :该对象的属性称为属性。 像年龄,性别,学生DOB; 或发动机的类型,汽车的齿轮数。

  3. Behaviour: Behaviour of any object is equivalent to the functions that it can perform. In OOP it is possible to assign some functions to objects of a class. Taking the example forward, like a student can read/write, the car can accelerate and so on.

    行为 :任何对象的行为都等同于它可以执行的功能。 在OOP中

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值