摘要
Abstract class和Interface是Java语言中对于抽象类定义进行支持的两种机制,正是由于这两种机制的存在,才赋予了Java强大的面向对象能力。Abstract class和Interface之间在对于抽象类定义的支持方面具有很大的相似性,因此很多开发者在进行抽象类定义时对于Abstract class和Interface的选择显得比较随意。但是,两者之间的区别还是很大的。文中从两者的定义、程序编辑、设计意图3个方面加以了比较。由此,对于它们的选择,反映出对于问题领域本质的理解和对于设计意图的理解是否正确、合理。
Two mechanisms of abstract class and interface are supported for the abstract class definition of Java language. Being of two mechanisms endow the powerful ability of OO. There have great similarities that two mechanisms of abstractclass and interface are support for the abstractclass definition, therefore, the choice is random. But the distinction of the two is great, The distinction was made from the two definitions, procedures editorial, design intentation in this article. So, it is the key that how to choose them to make the designed - intention right and reasonable when the system is designed.
出处
《计算机技术与发展》
2006年第8期110-112,115,共4页
Computer Technology and Development