What does python mean by object-oriented? Introduction to the concept of object-oriented nine

Source: Internet
Author: User
Python has been an object-oriented language since its inception, which is why it is easy to create a class and object in Python. In this article, I'll cover Python's object-oriented knowledge in detail.

If you have not been exposed to object-oriented programming languages before, you may need to first understand some of the basic features of object- oriented languages and form a basic object-oriented concept in your mind, which will help you learn more about Python's object-oriented programming.

Let's start with a brief look at some of the basic features of object-oriented.

Introduction to Object-oriented technology

1. Class: Used to describe a collection of objects that have the same properties and methods. It defines the properties and methods that are common to each object in the collection. An object is an instance of a class.

2. Class variables: Class variables are common throughout the instantiated object. Class variables are defined in the class and outside the body of the function. Class variables are not typically used as instance variables.

3. Data member: A class variable or instance variable that is used to manipulate the data related to the class and its instance objects.

4. Method overrides: If the method inherited from the parent class does not meet the requirements of the subclass, it can be overridden, which is called the override of the method, also known as the override of the method.

5. Instance variable: A variable defined in a method that acts only on the class of the current instance.

6. Inheritance: A derived class (derived class) inherits the fields and methods of the base class (base classes). Inheritance also allows the object of a derived class to be treated as a base class object. For example, there is a design where an object of type dog is derived from the animal class, which is the analog "is a (is-a)" Relationship (example, dog is a animal).

7. Instantiation: Create an instance of a class, the concrete object of the class.

8. Method: The function defined in the class.

9. Object: An instance of the data structure defined by the class. The object consists of two data members (class variables and instance variables) and methods.

Related Article

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.