首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列代码段中声明了3个类: class Person{}; class Student:public Person{}; class Undergraduate:Student{}; 下列关于这些类之间关系的描述中,错误的是
下列代码段中声明了3个类: class Person{}; class Student:public Person{}; class Undergraduate:Student{}; 下列关于这些类之间关系的描述中,错误的是
admin
2017-07-05
49
问题
下列代码段中声明了3个类:
class Person{};
class Student:public Person{};
class Undergraduate:Student{};
下列关于这些类之间关系的描述中,错误的是( )。
选项
A、类Person是类Undergraduate的基类
B、类Undergraduate从类Student公有继承
C、类Student是类Person的派生类
D、类Undergraduate是类Person的派生类
答案
B
解析
本题考查基类和派生类的逻辑关系,属于基础知识,如果没有指明哪种继承方式,那么默认为私有继承,所以B选项错误。
转载请注明原文地址:https://kaotiyun.com/show/7LAp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列程序的运行结果是【 】。#include<iostream.h>#include<string.h>voidmain(){char*a[5]={"stuent","worker","tea
下面程序的运行结果是( )。 #include <iostream> using namespace std; template <class T> class A{ T x,y; public:
若需要利用形参直接访问实参,则应把形参变量说明为( )参数。
下面关于虚函数的描述中,正确的是()。
在C++中的实型数据分为三种类型,即单精度float、双精度double和【 】。
假定要动态分配一个类型为Worker的具有n个元素的数组,并由r指向这个动态数组,则使用的语句是【 】。
非成员函数只有在声明为(),才能访问这个类的所有private成员。
下列格式化I/O的操作符中,()是设置域宽的。
下列符号中可以用作C++标识符的是()。
随机试题
肉眼血尿是指每升尿中含血量超过
撤销认证的企业()后可重新提出认证申请。
计算机硬件提供了处理数据的物质基础,但如果没有软件的支持,它什么事情也做不了,因此,硬件只是计算机的躯体,软件才是它的灵魂。()
住宅不受侵犯属于我国公民的()。
西原借款
[2014年]设且a≠0,则当n充分大时,有().
关于并行数据库,下列说法正确的是()。
ApologyHelpsItisnevereasytoadmityouareinthewrong.Beinghuman,weallneedtoknowtheartofapologizing.Look
UsingLyricstoDevelopStudents’CriticalLiteracySonglyricscanbeusedeffectivelyin【T1】toprovidethe【T1】______voice
TwosimplebuteffectivetipsforhavingabusinesstalkPrepareGatherasmuchinformationasyoucanbeforethebusiness
最新回复
(
0
)