首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下类定义: class AA{ int a: public: AA(int n=0):a(n){} } ; class BB:public AA{ public: BB(int n)_________
有如下类定义: class AA{ int a: public: AA(int n=0):a(n){} } ; class BB:public AA{ public: BB(int n)_________
admin
2019-05-06
67
问题
有如下类定义:
class AA{
int a:
public:
AA(int n=0):a(n){}
} ;
class BB:public AA{
public:
BB(int n)_________
};
其中横线处缺失部分是( )。
选项
A、:a(n){}
B、:AA(n){}
C、{a(n);}
D、{a=n;}
答案
B
解析
根据派生类构造函数的一般格式:<派生类名>(<总参数表>):<基类名1>(<参数表1>),…<基类名n>(<参数表n>),<成员对象名1>(<参数表n+l>),…<成员对象名m>(<参数表n+m>)<派生类构造函数体>。在派生类BB的构造函数总参数表后面应该接上基类名AA和其参数。
转载请注明原文地址:https://kaotiyun.com/show/Cs8p777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有如下类声明:classMyClass{inti;private:intj;protected:intk;public:intm,n;};其中,私有成员的数量为_
下列程序的输出结果是______。#include<iostream.h>#include<string.h>usingnamespacestd;voidfun(constchar*s,char&C){c=s[s
有以下程序:#include<iostream>usingnamespacestd;classMyClass{public:staticints;MyClass();voidSet
如下程序的输出结果是______。#include<iostream>usingnamespacestd;classWages{//“工资”类doublebase;//基本工资dou
有如下递归函数:intFun(intn){if(n<=1)return1;______请补充完整,使得函数Fun能够正确计算形参n的阶乘。
如下程序的输出结果是______。#include<iostream>usingnamespacestd;intfunl(intx){return++x;}intfun2(int&x){return++x;
运算符函数调用格式的表达式“y/x++”与表达式“y.operator/(operator++(x,0))”的含义相同,由此可看出()。
在下列关键字中,不能用来表示继承方式的是
在数据库设计中,将E-R图转换成关系数据模型的过程属于
一个项目具有一个项目主管,一个项目主管只可管理一个项目,则实体“项目主管”与实体“项目”的联系属于______的联系。
随机试题
下列解剖标志中不属于口腔前庭范围的是
下列哪些为先天性肌性斜颈行胸锁乳突肌切除的注意事项
下列哪种汗证最危急而且预后差
患者女,18岁,左脚趾甲沟炎并发甲下脓肿,疼痛重,压痛明显。应采取的最佳措施是
对企业股权投资所得的所得税的处理,错误的是()。
简述新招聘人员信息的收集内容。
SoonafterDaveleftuniversity,oneofhisuncles,whowas【C1】______andhadnochildrenofhisown,diedand【C2】______Davealo
WhyhascrimeintheU.S.declinedSOdramaticallysincethe1990s?Economistsandsociologistshaveofferedabountyofreas
Forthefirsttime,GeorgeBushhasacknowledgedtheexistenceofsecretCIAprisonsaroundtheworld,wherekeyterroristsuspe
Themayorwasaccusedof
最新回复
(
0
)