A.x. value+x. getAmount()
B.x. getData()-x. getAmount()
C.x. getData()-x. amount
D.x. value+x. amount
[单选题]有如下类声明: class Base{ protected: int amount; public: Base(int n=0):araount(n){ } int getAmount( )const{retum amount;} }; class Derived:public Base{ protected; int value; public: Derived(int m,int n):value(n1),Base(n){ } int getData( )const{return value
[单选题]有如下程序:includeclass Base{protected:int i;public:int j;};class Derived:pub有如下程序: #include<iostream.h> class Base { protected:int i; public:int j; }; class Derived:public Base { int m; public:int n; }; int main() { Derived d; d.i=0; //[1]d.j=0; //[2]d.m
[试题]有如下类声明:class MyClass{int i;private: int j;protected:int k;public:int m, n;};其中,私有成员的数量为 ( 9 ) 。
[单选题]有如下类声明: class TestClass int i; private:int j; protected:int k; public:int m,n; 其中,私有成员的数量为( )。A.0B.1C.2D.3
[单选题]有如下类声明: class XA { int x; public: XA(int n){x=n;} }; class XB:public XA { int y; public: XB(int a,int b); }; 在构造函数XB的下列定义中,正确的是A.XB::XB(int a,int b):x(a),y(b){}B.XB::XB(int a,int b):XA(a),y(b){}C.XB::XB(int a,int b):x(a),XB(b){}D.XB::XB(int a,int b):
[单选题]有如下类声明:class XA{int x;public:XA(int U)}x=n;}};class XB:public XA{int y;public:XB(int a,int B) ;};在构造函数XB的下列定义中,正确的是A.XB::XB(int a,int B) :x(A) ,y(B) {}B.XB::xB(int a,int B) :XA(A) ,y(B) {}C.XB::XB(int a,int B) :x(A) ,XB(B) {}D.XB::XB(int a,int B) :XA
[单选题]有如下类声明: class XA { int x; public: XA(int n) {x=n;} }; class XB: public XA{ int y; public: XB(int a,int b); };在构造函数XB的下列定义中,正确的是______。A.XB:: XB(int a, int b):x(a),y(b) { }B.XB::XB(int a, int b):XA(a),y(b){}C.XB::XB(int a,int b):x(a),XB(b)i}D.XB::XB(i
[单选题]有如下类声明:class XA{int x;public:XA(int n){x=n;}};class XB:public XA{int y;public:XB(int a, int b) ;};在构造函数XB的下列定义中,正确的是A.XB::XB(int a,int B) :x(A) ,y(B) {}B.XB::XB(int a,int B) :XA(A) ,y(B) {}C.XB::XB(int a,int B) :x(A) ,XB(B) {}D.XB::XB(int a,int B) :X
[单选题]有如下类声明:class SAMPLE{int n;public:SAMPLE (int i = 0): n(i){}void setvalue(int n0);};下列关于 setvalue 成员函数的实现中,正确的是A. . SAMPLE::setvalue(int n0){n = n0;}B. . void SAMPLE::setvalue(int n0){n = n0;}C. . void setvalue(int n0){n = n0;}D. . setvalue(int n0){n
[单选题]有如下类声明: class MyBASE{ int k; public: void set(iht n){k=n;} int get()coast{return k;} }; class MyDERIVED:pnoted My BASE { protected: int j; public: void set(int m,int n){MyBASE::set(m);j=n;} int get()const{return MyBASE::get()+j;} }; 则类MyDERIVED中保护的数据