面向对象必看的9大重点
一、面向对象的要素
1. 抽象性 , 2. 封装性 ,3.共享性 ,4. 强调对象结构而不是程序结构
面向对象的三大特点(封装,继承,多态)缺一不可
二、class MyPc{
public $name; —>成员属性(可以理解为自定义变量)
var $price;
function vod() { —>成员方法(可以里金额为自定义函数)
return "bkJia视频教程";
}
}
$pc1 = new MyPc(); —>实例化类
$pc1->name; —>使用 -> 访问对象内容
三、OOp object Oriented Program 解释:程序向导开发
四、$this关键字是用来访问当前对象中的对象属性和对象方法的系统变量
五、析构函数 :能够在对象释放时自动被调用的方法被称为析构函数
六、封装关键字 :public,protected,private
封装相关函数:__set() , __get()
七、public 表示全局,类内部外部子类都可以访问;
protected表示受保护的,只有本类或子类或父类中可以访问;
private表示私有的,只有本类内部可以使用;
八、继承关键字 :extends 单一继承
九、基类方法重载和父类方法访问 重载方法 基类名 :: 方法名称

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver Mac version
Visual web development tools

Atom editor mac version download
The most popular open source editor
