类与接口继承

An object' class defines how the object is implemented. The class defines the object's internal state and the inplementation of its operations. In constract, an object's type only refers to its interface----the set of requests to which it can respond.

It's important to understand the difference between class inheritance and interface interitance. Class inheritance defines an object's implement in terms of another object's implement. In short, it's a mechanism for  code and representation sharing. In constract, interface inheritance describes when an object can be used in place of another.

posted @ 2011-09-30 20:26  御剑逍遥  阅读(160)  评论(0编辑  收藏  举报