您的位置:首页 > 运维架构

OOP Bisic-desctructor can be virtual,while constructer can not? why?

2008-02-26 11:21 337 查看
A:

virtual function uses virtual calling. virtual calling is a kind of operation mechanism which can run on the condition of part information being provided. it allows us to call a function that we only know the interface while not know accurate object type of the function.

However if we create an object, you must know what kind of the object is accrurately! Therefore, the constructor can not be virtual.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐
-->
新的分享
章节导航