摘要
多态性是C++面向对象语言的特征之一,多态性是要在调用函数时使用对象的指针或引用。另外,多态性仅用于类层次结构,所以能以一具类中派生另一个类不是多态性的基本条件。虚函数是动态联编的基础,它经过派生之后,在类族中就可以实现运行过程中的多态。动态联编恰是反映C++语言中的多态性的具体体现。本文先阐述了静态联编和动态联编的概念和区别,而后以几个实例说明实现动态联编的条件。
Polymorphism is one of characters of C++ Object-Oriented Programming Language. Inheritance is basement of Virtual Functions, which is basic of dynamic binding. After deriving, Polymorphism is accomplished on the course of programme running. Dynamic binding fully reflects polymorphism. This thesis discusses concept and difference of static binding and dynamic binding. It describes condition of realizing dynamic binding.
出处
《洛阳工业高等专科学校学报》
2004年第4期40-42,共3页
Journal of Luoyang Technology College
关键词
C++
静态联编
动态联编
多态性
虚函数
条件
Static binding
Dynamic binding
Realizing condition
Virtual functions
C++