Object-oriented programming day 23

Today's content:

A process-oriented and object-oriented
- Concepts:
'' '
for the process:
advantages: the process of complex issues, and further simplification
is determined: poor scalability

Object-oriented:
advantages: high scalability
disadvantages: the preparation of the complex
'' '


2 with the object class
- defined class
class keyword category name:
Pass
- generating an object
the object class name = ()
- class:
properties and methods of obtaining a class
class .__ dict__
Class 2 to call the properties and methods
1 to pick up by dict (complex without)
class 2 properties / functions.
- Object:
an object properties and methods of obtaining
objects dict__ .__
2 to call the object properties and methods
. object properties / methods

3 generates an object (binding methods, properties search sequence)
- attribute search order
- starting with the objects themselves find ------> class to find -----> given
- Fu Object Properties
- a way:
STU1 = Student ()
stu1.name = 'Nick SB'
- Second way (by the __init__):
- the method is defined in the class, method parameters write
- when an object instance of the object is generated, the transmission values in parentheses, will __init__ is passed in
- bound method:
- defined inside the class
- object to call, it will automatically pass over the object, you can modify the object inside the method

4 Everything target

5 little exercise
people and dogs shootout

job:
Based on object-oriented design an arcade game

https://www.cnblogs.com/linhaifeng/articles/6182264.html
methods and functions

 

Guess you like

Origin www.cnblogs.com/wwei4332/p/11412538.html