Object Class

1, object-oriented
classes: a model, a drawing.
Object: According to the model made out of things that instance.
Examples: Examples and objects is one thing.
Examples of: something specific to do is process model based on.
self: This class object.

Inheritance:
private method private variables are not inherited
1, if you want to override the extension on the basis of the parent class method, super () xxx call the parent class, then.
Corresponding parameters passed to
super will automatically find father

Abstract class: a standard,
package:
the static method: just write in a method of the class can not use class variables, class methods can not call other
instances: You must function before it can be used to instantiate.
Instance variables: class attribute is the variable after variable must be instantiated in order to use the
class variables: variables in a class which directly define the
class method: do not instantiated by the class name to the method can be called directly, with examples also can call
properties methods: looks like a variable function.
Constructors: class method called automatically when instantiating
destructor: the method when the object is destroyed automatically calls
a private method: only inside the class calls the class would not be a
private variable: can only be used inside , would not be out of the class

1, how to define the class
class My:
DEF the __init __ (Self, name):
the self.name = name
DEF FUNC (Self)
the self.name = 'hHA'
Pass
DEF func2 (Self):
self.func ()
m My = ()
m.func ()
m.name

Guess you like

Origin www.cnblogs.com/lapt/p/11874471.html