为什么派生类构造函数总是访问基类构造函数? [英] Why should the derived class constructor always access base class constructor?

查看:80
本文介绍了为什么派生类构造函数总是访问基类构造函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的其中一份试卷中看到了这个问题:

I saw this question in one of my question papers:

为什么派生类构造函数总是访问基类构造函数?

我想知道问题是否正确吗?

I'm wondering whether the question is valid?

推荐答案

在开始弄乱派生对象中的继承功能之前,您可能已经具有基本类型的有效对象!

So that you may have a valid object of type "Base" before you start messing with the inherited functionality in your derived object!

这篇关于为什么派生类构造函数总是访问基类构造函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆