单项选择题

下列描述中,错误的是( )。

A.公有继承时基类中的公有成员在派生类中仍是公有成员
B.公有继承时基类中的保护成员在派生类中仍是保护成员
C.保护继承时基类中的公有成员在派生类中仍是公有成员
D.保护继承时基类中的保护成员在派生类中仍是保护成员
<上一题 目录 下一题>
热门 试题

单项选择题
下面程序的运行结果是( )。 #include <iostream.h> class Sample int x,y; public: Sample() x=y=0; Sample(int a,int b) x=a;y=b; void disp() cout<< x= <<x<< ,y= <<y<<endl; ; void main() Sample s(2,3), *p=&s; p->disp();
A.x=1,y=2


B.x=2,y=4
C.x=2,y=3


D.x=4,y=3
单项选择题
有如下程序: #include <iostream> using namespace std; class Base public: Base()cout<< BB ;f(); Void f()cout<< Bf ; ; class Derived: public Base public: Derived() cout<< DD ; void f() cout<< Df ; ; int main() Derived d;return 0; 执行上面的程序将输出( )。
A.BBBfDD
B.BBDfDDDf
C.DD
D.DDBBBf
相关试题
  • 下面程序的运行结果是______。 #in...
  • 在下面横线上填上适当的语句,完成程序。 ...
  • 下列程序的输出结果是______。 #in...
  • 已知数组a中的元素个数为n,下列语句的作用...
  • 有如下程序: #include <iostream.h>...