Python OOP learning notes-1

1. python standard library: python 3.9.4 (1)format(): format(value[, format_spec]) Convert # value # to # format_ "Formatted" representation of spec # control. format_ The interpretation of spec , depends on the type of , value , argument, but most built-in types use standard formatting syntax: Format specification Mini lan ...

Added by Trek15 on Wed, 02 Mar 2022 02:20:42 +0200

Class and object knowledge points

C + + will provide a default constructor, destructor and default copy constructor   Shorthand method of constructor CCylinder(double r,double h) { radius=r; height=h; }; ==>CCylinder(double r,double h):radius(r),height(h){} [this method is limited to constructors]   Allocate space during construction and release space during deco ...

Added by kbrij on Sat, 19 Feb 2022 17:43:56 +0200

Rich second generation of Java inheritance relationship and his father

First, you need to know some definitions of inheritance. Briefly, but be sure to remember: In the concept of inheritance, there are subclasses and superclasses. The superclass is also called superclass or base class, and the subclass is also called derived class (don't change the word to be silly)Inheritance is for subclass objects to have the ...

Added by thewooleymammoth on Sat, 19 Feb 2022 08:37:44 +0200

JavaScript this keyword

JavaScript this keyword In object-oriented languages, this represents a reference to the current object. But in JavaScript, this is not fixed. It will change with the change of execution environment. In a method, this represents the object to which the method belongs.If used alone, this represents a global object.In the function, this repres ...

Added by Morbid on Thu, 17 Feb 2022 20:00:19 +0200

JS Foundation: four inheritance methods in JavaScript & instanceof implementation

JS Foundation: four inheritance methods in JavaScript & instanceof implementation preface If you don't know much about the prototype chain and type judgment of JS, it is recommended that you first read the following two articles and then come back to understand the principle and purpose of this article Prototype: Prototype Chain Foun ...

Added by AliasXNeo on Thu, 10 Feb 2022 16:48:11 +0200

Advance Python 03: drill down on classes and objects

Introduce: Duck type and polymorphism Abstract base class (abc module) The difference between isinstance and type Class variable and instance variable Class properties and instance properties, and search order Static methods, class methods, object methods, and parameters Data encapsulation and private properties Introspection mechanis ...

Added by poison6feet on Sat, 05 Feb 2022 20:36:28 +0200

yolov5 python API (for other programs to call)

Your yolov5 🚀 Is it limited to detect py? If other programs want to call yolov5, you need to make a detect python API for python. python has objects everywhere. Making the detect API is actually making the detect class. preface yolov5 Source code version: as of 2022.2.3 Link: https://github.com/ultralytics/yolov5 As a &quo ...

Added by ecco on Thu, 03 Feb 2022 20:40:41 +0200

Experiment 6 inheritance

1, Experimental purpose 1. Practice class inheritance and subclass construction methods. 2. Master method rewriting and method overloading. 3. Master the use of this and super. 2, Experiment type and class hours Verification / design / synthesis: verification; Class hours: 2. 3, Experimental environment Several microcomputers equipped ...

Added by johnb352 on Tue, 01 Feb 2022 10:45:27 +0200

Java object oriented

Object oriented and process oriented Process oriented: when a function needs to be realized, each specific step should be handled in detail. Object oriented: when I need to implement a function, I don't care about the specific steps, but find someone who already has the function to help me. import java.util.Arrays; public class Demo01PrintAr ...

Added by railanc4309 on Sun, 30 Jan 2022 19:32:30 +0200

Fundamentals of python -- classes

preface   we explained the functions in Python in detail through three articles, including How to write functions,How to pass arguments as well as How to use arguments and keyword arguments . Starting from this article, I'll introduce you to classes in Python. First, I'll introduce you to create and use classes. 1, Create and use classe ...

Added by ThEMakeR on Sun, 30 Jan 2022 18:45:52 +0200