Overview of Knowledge Points:
- Object-Oriented Introduction
- Object-oriented attribute (Class,object) instance variable, class variable
- Introduction to the programming of face object
- Private methods, private properties
First, object-oriented introduction
Programming Paradigm: Object-oriented, process-oriented, functional programming
- Process oriented: Tell the machine what to do with a set of instructions; a process consists of a set of steps to be computed, the order of execution from start to finish, and the change of the program to pay attention to the dependencies of each part, otherwise it will affect the operation of other processes, a series of effects, maintenance difficulties.
- Object-oriented: OOP programming is the use of classes and objects to create a variety of models to achieve a real-world description; The reason for using object-oriented programming is that it makes maintenance and expansion of programs easier and improves development efficiency. Makes the code clearer and easier to understand.
-
- All things in the world can be classified, and all things are objects.
- Just say: The object belongs to a certain kind of
- As long as the object, there must be attributes
Second, Characteristics:
- Class: An abstraction, blueprint, and prototype of an object that has the same attributes as an alien. In this class, you define the properties and common methods that these objects have.
- Object object: An instance of a class that is instantiated after it has to be instantiated before it can be called in a program
Three main features:
- Encapsulation: Assigning values to data in a class, internal calls are transparent to external users, which makes the class A capsule or container in which the data and methods of the class are contained.
- Inheritance: A class can derive from Thunder, in this Inveraray defined property, method automatic Quilt class inheritance
- Polymorphism: In simple terms, "there 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, but also the method of the parent class to make a different implementation, this is the same food shows a variety of forms
"Python automation Sixth article: Object-oriented"