摘要
abstractclass和interface是Java语言中对于抽象类定义的两种机制,它们之间在对于抽象类定义的支持方面具有很大的相似性,有时可以相互替换,因此很多初学开发者在进行抽象类定义时对于abstractclass和interface的选择上比较模棱两可。实际上,两者之间还是有区别的,对于它们的选择可以反映出对于问题领域本质的理解、对于设计意图的理解是否正确、合理。本文将对它们之间的区别进行一番剖析,试图给读者提供一个在二者之间进行选择的依据。
class.The similarity in their supportive functions in defining the abstract class makes it possible for the two to be used interchangeably.Therefore,many beginners may cut both ways in choosing abstract class or interface.Actually,the two should be distinguished.Abstract class or interface? The choice reelects one’s understanding of the inbeing of the problems and the intention of designing.This article is to analyze the differences between abstract class and interface in the hope of helping its readers make acceptable choices.
出处
《无锡南洋职业技术学院论丛》
2006年第4期50-53,共4页
Journal of Wuxi South Ocean College