oop-example

所属分类:编程语言基础
开发工具:PHP
文件大小:0KB
下载次数:0
上传日期:2019-08-05 07:29:12
上 传 者sh-1993
说明:  面向对象编程示例,
(Object Oriented Programming Example,)

文件列表:
OOP.txt (1295, 2019-08-05)
abstract.php (502, 2019-08-05)
encapsulation.php (535, 2019-08-05)
inheritance.php (607, 2019-08-05)
interface.php (242, 2019-08-05)
polymorphism.php (607, 2019-08-05)
static.php (491, 2019-08-05)

# Object Oriented Programming Example ## Static => Static method can be called without creating object (ex. ClassName::methodName()) => Static property can be used in same class (ex. self::$property) ## Modifiers 1. Public (Can be access in same class or out of class) 2. Private (Can be access only in same class) 3. Protected (Can be used in same class and inheritance or interface class) ## Inheritance => Parent child concept => Child class can be used parent class public and Protected data => Child class can't access parent class private data ## Polymorphism => Polymorphism means the ability to have many forms => Same name two methods can works different purpose => There are two types of Polymorphism: 1. Compile time (function overloading) 2. Run time (function overriding) ## Encapsulation => Hide data from user => GETTER and SETTER methods concept => Can be get data using method => Can be validate data in method ## Abstraction => Can't make Object => Can be used by 'extends' => Can be create method definition with or without method body => If we create abstract method, class must be abstract ## Interface => Can't make object => Can be used by 'implements' => Can be implements multiple interface class in same time => Only create method defination, no method body allowed

近期下载者

相关文件


收藏者