php写一个类实现一个接口的例子
来源:百度知道 编辑:UC知道 时间:2024/06/08 04:06:32
谁能写段这样的例子谢谢
<?php
interface demoInterface{
public function doIt();//声明方法
}
class hello implements demoInterface{
public function doIt(){
echo "实现接口中的方法";
}
}
$demo=new hello();
$demo->doIt();
?>
你看JAVA的就可以了..PHP在实现OO上是学习JAVA的