虚函数的多态性机制分析  

The Analyze to Polymorphphism of Virtual Function

在线阅读下载全文

作  者:李强[1] 吴源[1] LI Qiang,WU Yuan(Economic Department,South China Normal University ZC College,Guangzhou 512000,China)

机构地区:[1]华南师范大学增城学院经济系,广东广州512000

出  处:《电脑知识与技术》2011年第5期3089-3091,共3页Computer Knowledge and Technology

摘  要:在面向对象程序设计中,继承性映射了现实世界中事物之间的层次现象,而多态性则是映射事物自身行为的多外延现象;虚函数可以实现不同的对象在收到相同的消息时,产生不同的动作。重载是同一对象在收到相同的消息时,产生不同的动作。该文对虚函数的多态性机制进行深入分析,提出用虚函数实现多态性的四项法则。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.

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

分 类 号:TP312[自动化与计算机技术—计算机软件与理论;自动化与计算机技术—计算机科学与技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象