The nine key points of object-oriented thinking. 1. object-oriented elements 1. abstraction, 2. encapsulation, 3. sharing, 4. the three main characteristics (encapsulation, inheritance, and polymorphism) of the object structure rather than the object-oriented program structure lack one or more elements of the object-oriented
1. abstraction, 2. encapsulation, 3. Sharing, 4. emphasizing the object structure rather than the program structure
Three characteristics of object-oriented (encapsulation, inheritance, polymorphism) are indispensable
II. class MyPc {
Public $ name;-> member attributes (which can be understood as custom variables)
Var $ price;
Function vod () {-> Member method (the amount can be a custom function)
Return "bkJia video tutorial ";
}
}
$ Pc1 = new MyPc ();-> instantiate class
$ Pc1-> name;-> use-> access object content
3. OOp object Oriented Program explanation: Program Wizard Development
4. The $ this keyword is a system variable used to access the object attributes and object methods of the current object.
5. destructor: a method that can be automatically called when an object is released is called a destructor.
6. encapsulation Keywords: public, protected, and private
Encapsulate related functions: __set (), _ get ()
7. public indicates global, and internal and external subclass of the class can be accessed;
Protected indicates that it is protected and can be accessed only in this class or subclass or parent class;
Private indicates private, which can only be used inside the class;
8. Inheritance Keywords: extends single inheritance
9. base class method overloading and parent class method access overloading method base class name: method name
Abstraction 1. abstraction, 2. encapsulation, 3. Sharing, 4. emphasizing the object structure rather than the three main characteristics of the object-oriented program structure (encapsulation, inheritance, polymorphism) is missing...