PHP面向对象--接口类--抽象类

PHP面向对象在初学时就应该熟练掌握,但许久不用,总会生疏,在此补充记忆面向对象接口和抽象的概念。html 1.定义一个接口code interface ICanEat { public function eat($food); } 想实现此接口则须要实现eat方法,htm 2.实现接口对象 class Human implements ICanEat { // 跟Animal类的实现
相关文章
相关标签/搜索