-4
问候!!我想知道更多关于抽象类和接口。以及类似抽象类的术语扩展和接口implements.need一个帮助。请解决我的问题。提供一些事例。我很困惑在哎呀,我很困惑在术语抽象类扩展和接口实现在oops
问候!!我想知道更多关于抽象类和接口。以及类似抽象类的术语扩展和接口implements.need一个帮助。请解决我的问题。提供一些事例。我很困惑在哎呀,我很困惑在术语抽象类扩展和接口实现在oops
抽象类是未实例类,所以不存在像这样没有这样的事:
<?php
$p = new person();
?>
抽象类只能被继承,而不是直接使用。您将它用作基类,在其中放置其他类可以共享的所有代码。
的界面就像它methodes类必须实现的协议:
// Declare the interface 'iExample'
interface iExample
{
// methodes
}
// Implement the interface
// This will work
class Thingy implements iExample
{
// implement the methodes specifies in the interface
}
的可能重复[?是什么接口和抽象类的区别(http://stackoverflow.com/questions/ 1913098 /什么-是最差之间-的接口和抽象类) – JonH 2012-04-12 15:21:06