PHP面向对象
来源:互联网 发布:zepto.js animate 编辑:程序博客网 时间:2024/05/02 13:45
1、什么是面向对象
起初,“面向对象”是专指在程序设计中采用封装、继承、抽象等设计方法。可是,这个定义显然不能再适合现在情况。面向对象的思想已经涉及到软件开发的各个方面。
如:面向对象的分析(OOA,Object Oriented Analysis),
面向对象的设计(OOD,Object Oriented Design)
以及我们经常说的面向对象的编程实现(OOP,Object Oriented Program)。
面向对象的要素
1. 抽象性 , 2. 封装性 ,3.共享性 ,4. 强调对象结构而不是程序结构
例如:student.class.php
<?php
class Student{
public $name;
public $age;
public $sex;
function say(){
return $this->name."性别".$this->sex."在说话"."<br>";
}
function run(){
return $this->name."同学的年龄是".$this->age;
}
}
?>
duixiang.php
<?php
include "student.class.php";
$Student = new Student();
$Student->name="张三";
$Student->age=20;
$Student->sex="girl";
echo $Student->say();
echo $Student->run();
?>
- 【面向对象】php面向对象
- php面向对象--php面向对象ppt
- PHP面向对象精要
- PHP 面向对象编程
- PHP面向对象编程
- PHP 面向对象技术
- php 面向对象
- PHP面向对象编程
- Php面向对象01
- PHP面向对象笔记
- PHP面向对象v1:
- php 面向对象学习
- PHP-面向对象-OOP2
- PHP-面向对象-OOP3
- PHP-面向对象-OOP4
- PHP-面向对象-OOP5
- PHP-面向对象-OOP6
- PHP面向对象技术
- scp 无密码传输
- ASP.Net 去除字符串中的html标记
- 二级菜单
- 读研的那些事儿(五)
- 谈谈iOS下图像颜色检测、颜色匹配的解决方法
- PHP面向对象
- sql语法
- 。。。
- Mysql 数据类型
- 使用泛型迭代Map集合
- loveJ总结
- linux 批量删除 find exec rm
- Linux学习笔记----vim文本编辑软件
- 最大子矩阵问题(POJ1050)