设有以下定义和程序:includeclass A1{public: void show1(){cout 设有以下定义和程序:#include<iostream.h>class A1{public: void show1() { cout<<"class A1"<<endl; } };class A2 : public A1{public: void show2() { cout<<"class A2"<<end1 }};class A3 : protected A2{public: void show3() { cout<<"class A1"<<endl; }};void main(){ A1 obj1; A2 obj2; A3 obj3;} 则以下不合语法的调用语句是A.obj1. showl();B.obj2. showl();C.obj3. showl();D.obj2. show2();

设有以下定义和程序:includeclass A1{public: void show1(){cout<<"class A1"<

设有以下定义和程序:#include<iostream.h>class A1{public: void show1() { cout<<"class A1"<<endl; } };class A2 : public A1{public: void show2() { cout<<"class A2"<<end1 }};class A3 : protected A2{public: void show3() { cout<<"class A1"<<endl; }};void main(){ A1 obj1; A2 obj2; A3 obj3;} 则以下不合语法的调用语句是

A.obj1. showl();

B.obj2. showl();

C.obj3. showl();

D.obj2. show2();


相关考题:

以下程序中,错误的行为①include ②class A③{④public:⑤int n=2;⑥A(int val){cout 以下程序中,错误的行为 ①#include < iostream.h > ②class A ③{ ④ public: ⑤ int n=2; ⑥ A(int val){cout << val<<end1;} ⑦ ~A( 0{}; ⑧}; ⑨void main( 0 ⑩{ (11) Aa(0); (12)A.⑤B.⑥C.⑦D.(11)

有如下程序:includeusing namespace std;Class Base{public:Base(){cout 有如下程序: #include<iostream.h> using namespace std; Class Base { public: Base(){cout<<“BB”;f();} void{(){cout<<“BF”;} }; class Derived:public Base { public: Derived(){cout<<“DD”;} void f(){cout<<“Df”;) }; int mainA.BBBfDDB.BBDfDDDfC.DDD.DDBBBf

下列程序的运行结果是【 】。 include class SomeClass { public: SomeClass(int va 下列程序的运行结果是【 】。include <iostream. h>class SomeClass{public:SomeClass(int value) { some_value=value;};void show_data(void) { cout<<data<<"<<~some_value<<endl; };static void set_data(int value) {data=value; }private:static int data;int some_value};int SomeClass::datavoid main(void){SomeClass my_class(1001),your_class(2002);your_class. set_data(4004);my_elass. show_data()}

设有以下定义和程序:includeclass A1{public:void show1(){cout 设有以下定义和程序: #include<iostream.h> class A1 { public: void show1() { cout<<"class A1"<<end1; } }; class A2:public A1 { public: void show2() { cout<<"class A2"<<end1; } }; class A3:protected A2 { public: void show3() { cout<<"class A1"<<end1; } }; void main() { A1 obj1; A2 obj2; A3 obj3; } 则以下不合语法的调用语句是( )。A.obj1.show1();B.obj2.show1();C.obj3.show1();D.obj2.show2();

以下程序的执行结果是______。 include class A{ int a: public: void seta(int x) { 以下程序的执行结果是______。include<iostream.h>class A{int a:public:void seta(int x) {a=x;}void showa() {cout<<a<<end1;}};class B{int b;public:void setb(int x) {b=x;}void showb(){cout<<b<<end1;}};

设有以下定义和程序:includeclassA1{public:void show1(){ cout 设有以下定义和程序: #include<iostream.h> classA1 { public: void show1() { cout<<"classA1”<<end1; } }; classA2:public A1 { public: void show2() { cout<<"classA2"<<end1; } }; class A3:protected A2 { public: voidshow3() { cout<<"class A1”<<end1; } }; void main() { A1obj1; A2obj2; A3obj3; } 则以下不合语法的调用语句是A.obj1.show1();B.obj2.show1();C.obj3.show1();D.obj2.show2();

有以下程序:include using namespace std;class Base{public:Base(){}virtual void w 有以下程序: #include <iostream> using namespace std; class Base { public: Base(){} virtual void who() { cout<<"Base Class"<<end1; } ~Base(){} }; class Derivel : public Base { public: void who() { cout<<"Derivel Class"<<end1; } }; class Derive2 : public Base { public: void who () { cout<<"Derive2 Class"<<end1; } }; int main () { Base *p; Derivel obj1; Derive2 obj2; p=obj1; p=obj2; p->who ( ); return 0; } 执行程序后的输出结果是( )。A.Base ClassB.Derivel ClassC.Derive2 ClassD.程序编译时出错

以下程序中,错误的行为①include②class A③{④public:⑤int n=2;⑥A(int val){cout 以下程序中,错误的行为①#include<iostream.h> ②class A ③{ ④ public: ⑤ int n=2; ⑥ A(int val){cout<<val<<end1;} ⑦ ~A(){}; ⑧}; ⑨void main() ⑩{ (11) A a(0); (12)}A.⑤B.⑥C.⑦D.(11)

设有以下定义和程序:includeclassA1{public: void showl() { cout 设有以下定义和程序: #include <iostream.h> class A1 { public: void showl() { cout<<"class A1"<<end1; } }; Class A2 : public A1 { public: void show2() { cout<<"Class A2"<<end1; } }; Class A3 : protected A2 { public: void show3() { cout<<”Class A土”<<end1; } }; void main() { A1 obj1; A2 obj2; A3 obj3; } 则以下不合语法的调用语句是( )。A.obj1.show1();B.obj2.show1();C.obj3.show1();D.obj2.show2();