首页 | 本学科首页   官方微博 | 高级检索  
     

虚函数的多态性机制分析
引用本文:李强,吴源.虚函数的多态性机制分析[J].数字社区&智能家居,2011(13).
作者姓名:李强  吴源
作者单位:华南师范大学增城学院经济系;
摘    要:在面向对象程序设计中,继承性映射了现实世界中事物之间的层次现象,而多态性则是映射事物自身行为的多外延现象;虚函数可以实现不同的对象在收到相同的消息时,产生不同的动作。重载是同一对象在收到相同的消息时,产生不同的动作。该文对虚函数的多态性机制进行深入分析,提出用虚函数实现多态性的四项法则。

关 键 词:动态联编  虚函数  多态性  

The Analyze to Polymorphphism of Virtual Function
LI Qiang,WU Yuan.The Analyze to Polymorphphism of Virtual Function[J].Digital Community & Smart Home,2011(13).
Authors:LI Qiang  WU Yuan
Affiliation:LI Qiang,WU Yuan(Economic Department,South China Normal University ZC College,Guangzhou 512000,China)
Abstract:In Object-Oriented Programming,the Inheritance reflects things of herarchical phenomenon in real world,but the Polymorphphism reflects the phenomenon of external multi-appearance of things itself.The virtual function can occur distinct motion by receiving same message in distinct objects.Overloading can occur distinct motion by receiving same message in same objects.This paper analyses deeply to the Polymorphphism and proposes four rules about the realization of Polymorphphism.
Keywords:dynamic co-compiling  virtual function  polymorphphism  
本文献已被 CNKI 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号