单选题 C++
题号 #1545876


进入在线模考

参考答案

A

答案解析

派生类D公有继承父类B,所以obj可以访问基类B的公有,不能访问其它成员。

你可能感兴趣的试题

A.friend istream& operator >>(istream& is,MyClass& a);
B.friend istream& operator >>(istream& is,MyClass a);
C.istream& operator >>(istream& is,MyClass& a);
D.istream& operator >>(istream& is,MyClass a);
A.template<typename T>
     void swap(T a[],T b[],int size);
B.template<typename T>
     void swap(int size,T a[],T b[]);
C.tempate<typename T1,typename T2>
     void swap(T1 a[],T2 b[],int size);
D.template<class T1,class T2>
     void swap(T1 a[],T2 b[],int size);
找试题 · 找答案 · 找资料 在线模考