2012-04-12 47 views

回答

0

抽象类是未实例类,所以不存在像这样没有这样的事:

<?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 
}