面向对象必看的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

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

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

Dreamweaver Mac version
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
