摘要
多态性是面向对象语言的关键技术,其使用方法和内部原理是面向对象编程的技术难点之一。本文以C++为例,在分析面向对象语言多态性实现原理的基础上,指出了当派生类实际改写的虚函数与虚方法数量很少时,其技术实现机制存在缺陷,并提出了一种以字符串匹配来代替原有地址查找的解决方法。
Polymorphism is the key technique of the Object Oriented Programming Language, which operation method and internal theory is one of difficulty of the Object Oriented Program. This paper analysed the theory of Polymorphism and pointed out the limitation when rewrite few virtual function in derived class, and put forward a kind of solving method with the string matches to replace the seek address.
出处
《农业网络信息》
2009年第5期119-120,共2页
Agriculture Network Information
基金
河北省教育科学"十五"规划课题(0130104)
关键词
多态性
面向对象
虚函数
C++
Polymorphism
Object oriented
Virtual function
C++