从PHP V 4迁移到PHP v5时要利用的下一个重要特性是支持通过接口、抽象类和方法进行契约编程。
The next important feature to take advantage of when migrating from PHP V4 to V5 is support for contract programming through interfaces and abstract classes and methods.
Authenticator 是一个抽象类,所以需要从它派生出子类,并实现 getPasswordAuthentication() 方法来存储用户名和密码(见清单 13)。
The Authenticator class is abstract, so you'll need to subclass it and implement the getPasswordAuthentication() method to store the username and password (see Listing 13).
我们不能实例化一个抽象类,即使它们的字段和方法都是具体的。
We can't instantiate instances of abstract classes, even when all their field and method members are concrete.
应用推荐