( ! ) Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in D:\www\up\CSharp\class06.php on line 20 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0156 | 355224 | {main}( ) | ...\class06.php:0 |
( ! ) Warning: include(http://pub.houheaven.com/Nav02/Nav_deep2.htm): failed to open stream: no suitable wrapper could be found in D:\www\up\CSharp\class06.php on line 20 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0156 | 355224 | {main}( ) | ...\class06.php:0 |
( ! ) Warning: include(): Failed opening 'http://pub.houheaven.com/Nav02/Nav_deep2.htm' for inclusion (include_path='.;C:\php\pear') in D:\www\up\CSharp\class06.php on line 20 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0156 | 355224 | {main}( ) | ...\class06.php:0 |
类的继承有一个缺点,单一继承,即一个派生类一次只能从一个基类中继承。
为了能够实现多重继承,那就要使用接口来实现。
接口不是类,而是一组对类的要求,接口用来描述类的功能,而不指明具体的实现方式。只要类实现了接口,就可以在任何需要该接口的地方使用这个类的对象。
接口成员必须是方法、属性、事件或索引器,不能包含常数、字段、运算符、实例构造函数、析构函数或类型,也不能包含任何静态成员。
接口本身不提供它所定义的成员的实现,只是指定实现该接口的类或接口必须要提供的成员。
声明格式:访问修饰符 interface 接口名
继承格式:访问修饰符 class 类名:接口名,接口名
抽象类是一种不能实例化,只能被继承的类,抽象类中的成员可以是被完全实现的,更多的是部分被实现或在抽象类中完全不被实现的。因此,抽象类可以封装其派生类中通用不变的功能。
接口是抽象成员的集合,可以被看做操作规则的要求,由接口的开发者区实现。
格式:访问修饰符 abstract class 类名(){……}
[ 后天堂 | 这里,只泊同流人 ]