MySQL class inherit class Stu extends human
1,. With one class as the parent class and another class as a subclass, the subclass inherits the property methods inside the parent class.
2. Code reuse and brevity
3. There can only be one parent class
4, public and protected can inherit, and have access and modify the permissions
5, private things can inherit but can not use or access
6. If you want to invoke a private property inside a parent class, you should use the Parent:: Method or property
7. After inheriting the parent class, the permission can only be more and more relaxed, not more strict.
If the Cry method permission for the parent class is inherited by the public subclass, it is wrong to change to protected.
8, the construction method will also be inherited __construct () can also be modified
9, but after rewriting causes initialization work cannot complete, how to do? : When subclass inherits, subclass has constructor, insure a little call parent::__construct ();
10, inherited property methods: The parent class has subclasses, there are subclasses of the parent class can be overridden, the parent class does not have subclasses can add
Object-Oriented inheritance