RSS
热门关键字:
当前位置 :| 主页>JAVA Development>

The abstraction in detailed and analytic Java kind the distinction with interfac

来源: 作者:Stand originally 时间:2008-12-21 Tag: 点击:


Brief summary

1.abstract Class is denotive in Java language it is a kind of successive relation, kind can use successive relationship only. But, kind can realize many Interface however.

2. There can be oneself data member in Abstract Class, also can have the member method that is not Abstarct, and in Interface, the data member that cannot be revised what can have a static state only (must be Static Final namely, general in Interface nevertheless adventitious justice data member) , all member methods are Abstract.

3.abstract Class and the design concept that Interface place mirrors instead are different. Abstract Class is actually denotive it is "is-a" relation, interface is denotive it is "like-a" relation.

4. Implementation is abstract kind with interface kind must implement among them all method. Abstract kind in can have blame abstraction method. There cannot be implementation method in interface.

5. The variable acquiesce of the definition in interface is Public Static Final model, and must give its initial value, come true so kind in cannot redefine, unalterable also its are worth.

6. Abstract kind of medium variable is acquiescent it is Friendly model, its value can be in subclass redefine, also can assign afresh.

7. The methodological acquiesce in interface is Public, of Abstract type.

Conclusion

Two kinds of definitions that Abstract Class and Interface are Java language call the turn are abstract kind means, there is very big similar sex between them. But often mirror instead again however to their choice reasonable, because they behaved the disparate impact between the concept (although can the function of implementation requirement) . This also is usage of a kind of the language be used to actually, hope reader friend can fine fine experience.

最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册
栏目列表
热点关注
相关文章