【单选题】【消耗次数:1】
下列说法中,有关构造函数是正确的是()
任何一类必定有构造函数
可定义没有构造函数的类
构造函数不能重载
任何一类必定有缺省的构造函数
参考答案:
复制
纠错
相关题目
【单选题】 下列说法中,有关构造函数是正确的是
①  任何一类必定有构造函数
②  可定义没有构造函数的类
③  构造函数不能重载
④  任何一类必定有缺省的构造函数
【单选题】 如果没有为一个类定义任何构造函数的情况下,下列描述正确的是( )
①  编译器总是自动创建一个不带参数的构造函数
②  这个类没有构造函数
③  这个类不需要构造函数
④  该类不能通过编译
【单选题】 如果没有为一个类定义任何构造函数的情况下,下列描述正确的是( )
①  编译器总是自动创建一个不带参数的构造函数
②  这个类没有构造函数
③  这个类不需要构造函数
④  该类不能通过编译
【单选题】 如果没有显式定义构造函数(包括复制构造函数),C++编译器就()
①  出现编译错误
②  没有构造函数
③  必须显示定义
④  隐式定义默认的构造函数
【单选题】 在创建派生类对象时,构造函数的执行顺序是()
①  对象成员构造函数―基类构造函数―派生类本身的构造函数
②  派生类本身的构造函数―基类构造函数―对象成员构造函数
③  基类构造函数―派生类本身的构造函数―对象成员构造函数
④  基类构造函数―对象成员构造函数―派生类本身的构造函数
【判断题】 构造函数用于创建类的实例对象,构造函数名应与类名相同,返回类型为void。
①  正确
②  错误
【单选题】 对于一个类的构造函数,其函数名与类名()
①  完全相同
②  基本相同
③  不相同
④  无关系
【单选题】 多继承的构造顺序序可分为如下4步:①所有非虚基类的构造函数按照它们被继承的顺序构造;②所有虚基类的构造函数按照它们被继承的顺序构造;③所有内嵌对象的构造函数按照它们声明的顺序构造;④派生类自己的构造函数体;这4个步骤的正确顺序是( )
①  ④③①②
②  ②④③①
③  ②①③④
④  ③④①②
【单选题】 多继承的构造顺序序可分为如下4步:①所有非虚基类的构造函数按照它们被继承的顺序构造;②所有虚基类的构造函数按照它们被继承的顺序构造;③所有内嵌对象的构造函数按照它们声明的顺序构造;④派生类自己的构造函数体;这4个步骤的正确顺序是( )
①  ④③①②
②  ②④③①
③  ②①③④
④  ③④①②
【单选题】 下面是有关子类继承父类构造函数的描述,其中正确的是( )。
① 
②  创建子类的对象时,先调用子类自己的构造函数,然后调用父类的构造函数
③  子类无条件地继承父类不含参数的构造函数
④  子类必须通过super关键字调用父类的构造函数
⑤  子类无法继承父类的构造函数
随机题目
【单选题】 The fact ________ that we are behind the other classes.
①  seems to be
②  must be
③  remains
④  take
【单选题】 By _________ learning possible anytime and anywhere, distance education is a powerful tool for supporting lifelong learning.
①  making
②  make
③  made
④  be made
【单选题】 One big of formal education is the high cost.
①  advantage
②  disadvantage
③  problem
④  condition
【单选题】 No more having to buy expensive textbooks which you will only use for a year or two and then sell or _______ away.
①  get
②  give
③  take
④  gain
【单选题】 Lifelong learning is both formal and non-formal; and the boundaries between face-to-face teaching and ___________ education are increasingly blurred.
①  lifelong
②  formal
③  distance
④  far
【单选题】 I hope you are making ________ for continuous education in your life.
①  room
②  vacancy
③  place
④  like
【单选题】 Some universities offer free, non-credit MOOCs __________ to anyone in the world.
①  useful
②  available
③  easy
④  careful
【单选题】 Well, that’s to say, every coin has two sides, ________ technology.
①  so is
②  so does
③  so has
④  so did
【单选题】 _________ the regular classes, you can also attend many different seminars and take part in many extracurricular activities.
①  Except for
②  Including
③  Apart from
④  Included
【单选题】 —How long have you been graduated from your college?— .
①  Yes, I’ve been graduated
②  I’ve been graduated for five years
③  I graduated from my college last year
④  I graduat from my college last year