<?php
interface father{
function shuchu();
}
interface fam extends father{
function cook($name);
}
class test implements fam{
function shuchu(){
echo "接口继承,要实现两个抽象方法";
echo "<br>";
}
function cook($name){
echo "平时经常做饭的人是:".$name;
}
}
$t=new test();
$t->shuchu();
$t->cook("妈妈");
?>
接口继承,要实现两个抽象方法 平时经常做饭的人是:妈妈
<?php
interface father{
function shuchu();
}
interface mother{
function dayin($my);
}
interface fam extends father,mother{
function cook($name);
}
class test implements fam{
function dayin($my){
echo "我的名字是:".$my;
echo "<br>";
}
function shuchu(){
echo "接口继承,要实现两个抽象方法";
echo "<br>";
}
function cook($name){
echo "平时经常做饭的人是:".$name;
}
}
$t=new test();
$t->shuchu();
$t->dayin("小强");
$t->cook("妈妈");
?>
接口继承,要实现两个抽象方法 我的名字是:小强 平时经常做饭的人是:妈妈
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有