单项选择题
有如下类的定义。空格处的语句是
class MyClass
______int x,y;
public:
MyClass(int a=0,int b=0)
x=a;
y=b;
staticvoidchange()
x-=10;
y-=10;
;
A.static
B.const
C.private
D.不需要填入内容
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下程序: #include<iostream> using namespace std; class Base private: char c; piblic: Base(char n):c(n) ~Base() cout<<C; ; class DeriVed:public Base private: char c; public: Derived(char n):Base(n+1),c(n) ~Derived() cout<<c; ; int main() Derived obj(’x’); return 0; 执行上面的程序将输出
A.xy
B.yx
C.x
D.y
点击查看答案&解析
单项选择题
有以下程序 #include<iostream> using namespace std; class Base private: char c; public: Base(char n):c(n) ~Base() cout<<c; ; class Derived:public Base private: char c; public: Derived(char n):Base(n+1),c(n) ~Derived() cout<<c; ; int main() Derived obj(’x’); return 0; 执行后的输出结果是
A.xy
B.yx
C.x
D.y
点击查看答案&解析
相关试题
有如下程序: #include<iostream> usi...
有以下程序 #include<iostream> using...
设有以下定义和程序: #include<iostrea...