摘要
多形性是将多个意义赋予同一名字的能力。在面向对象方法中,运用多形性可以大大提高开发软件的效率和质量。该文首先介绍了多形性的几种表现形式,然后着重通过几个具体的例子说明如何利用面向对象编程语言C++中的虚函数机制来灵活运用多形性,最后对多形性的实质及不足之处作了探讨。
Polymorphism is the ability of assigning multiple meanings to one name.While applying Object-Oriented technique,we can use polymorphism to improve the efficiency of software design and the quality of the software.This paper first introduces the different representation form of polymorphism in programming language,then explains how to take the advantage of polymorphism by using virtual function mechanism in C++ programming language.At the end of the paper,some discussions about the polymorphism's essential and shortage are presented.
出处
《计算机工程与应用》
CSCD
北大核心
2001年第13期141-144,共4页
Computer Engineering and Applications