单项选择题

下列说法中错误的是( )。

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

单项选择题
有如下程序 #include <iostream> using namespace std; class base public: virtual void f1() cout<< F1Base ; virtual void f2() cout<< F2Base ; ; class derive: public base void f1() cout<< F1Derive ; void f2(intx) cout<< F2Derive ; ; int main() base obj1,*p; derive obj2; p=&obj2; p->f1(); p->f2(); return 0; 执行后的输出结果是( )。
A.F1Derive F2Base
B.F1Derive F2Derive
C.F1Base F2Base
D.F1Base F2Derive
单项选择题
下面程序的运行结果是( )。 #include <iostream.h> int x=5; int fun(int a) int c; c=x*a; return c; void main() int x=3,a=4; x=x+fun(a); cout<< X= <<x<<endl;
A.x=15
B.x=17
C.x=23
D.x=25
相关试题
  • 下面程序的输出结果是______。 #in...
  • a[9-i]
  • 以下程序的执行结果是______。 #in...
  • 下面程序的运行结果是______。 #in...
  • 下列程序的运行结果为______。 #in...