第38749题 判断题
如下列代码所示的基类(base)及其派生类(derived),则生成一个派生类的对象时,只调用派生类的构造 函数。
#include <iostream>
using namespace std;

class base {
    public:
    base() {
        cout << "base constructor" << endl;
    }
    ~base() {
        cout << "base destructor" << endl;
    }
};

class derived : public base {
    public:
    derived() {
        cout << "derived constructor" << endl;
    }
    ~derived() {
        cout << "derived destructor" << endl;
    }
};
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
知识点:
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析