Python Object-oriented

Source: Internet
Author: User

Object-oriented programming--object oriented programming, short for OOP, is a programming idea. OOP takes objects as the basic unit of a program, and an object contains functions for data and manipulating data.

Process-oriented programming treats a computer program as a set of commands, which is the sequential execution of a set of functions. In order to simplify the program design, the process will continue to cut the function into sub-function, that is, the large function by cutting into small block function to reduce the complexity of the system.

Object-oriented programming treats a computer program as a set of objects, and each object can receive messages from other objects and process them, and the execution of a computer program is a series of messages passing between objects.

In Python, all data types can be treated as objects and, of course, objects can be customized. The custom object data type is the concept of class in object-oriented.

Class

A class is an abstraction of an object that has the same properties.

Object objects

The object is obtained by instantiating the class. A class can instantiate many objects. The class must also be instantiated before it can be called.

Packaging

The assignment of data in a class, internal invocation is transparent to the outside, which makes the class into a capsule or container, in which the data and methods of the class are contained.

Inherited

A class can derive subclasses, properties, methods defined in the parent class, automatic quilt class inheritance

Polymorphic

Simple point is an interface, a variety of implementations, refers to a base class derived from a different subclass, and each subclass inherits the same method name at the same time the parent class method to do a different implementation, this is the same thing shows a variety of forms.

Python Object-oriented

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.