function checkEat($obj){
if($obj instanceof ICanEat){
$obj->eat('food');
}else{
echo "The obj can't eat.\n";
}
}
if($obj instanceof ICanEat){
$obj->eat('food');
}else{
echo "The obj can't eat.\n";
}
}
2018-01-28
Nbaplaye$jordan = new Nbaplayer();中的Nbaplayer()跟上面的class Nbaplayer()有關(guān)系嗎
2018-01-25
10個(gè)程序員是10個(gè)方法名,功能卻一樣!這特么就尷尬了!所以,,接口來了,都用一個(gè)名字
2018-01-22