摘要
多态是面向对象程序设计的重要机制。多态数据结构是多态性机制的一种表现形式。通过分析继承结合动态联编机制并利用支持运行时多态性的虚函数和抽象类的特征,得出构建多态数据结构的基本方法,并以多态数组和多态队列两个实例说明多态数据结构在面向对象程序设计C++语言中的具体实现。
Polymorphism is a main mechanism of the object-oriented programming.Polymorphic dada structure is an expressive way of the polymorphism.This paper analyzes the mechanism of combining inheritance with dynamic binding.Features of virtual function to support dynamic polymorphism and the abstract class are discussed and the elementary method to construct the polymorphic data structure is proposed.Two examples of polymorphic array and polymorphic queue are presented to show the realization of polymorphic dada structure in the object- oriented programming C ++ language.
出处
《河池学院学报》
2009年第5期55-60,共6页
Journal of Hechi University
关键词
多态性
虚函数
多态数据结构
多态数组
多态队列
polymorphism
virtual function
polymorphic dada structure
polymorphic array
polymorphic queue