请将下列类定义补充完整。
class Base{public:void fun(){cout<<"Base::fun"<<end;}};
class Derived:public Base
{
public:
void fun()
{
【 】//显式调用基类的fun函数
cout<<"Derived::fun"<<endl;
}
};
第1题:
在下列横线处应添加的语句是( )。 class Base{public:void fun(){cout<<"Base::fun"<<end1;}}; class: Derived: public Base { public: void fun() { ______//显示调用基类的fun函数 cout<<"Derived::fun"<<end1; } };
A.Derived::fun
B.Base::fun();
C.Pubic::fun
D.fun();
第2题:
请将下列类定义补充完整。
class Base{public:void fun( ){cout<<"Base::fun"<<endl;}};
class Derived:public Base
{
public:
void fun( ){
______//显式调用基类的fun函数
cout<<"Derived::fun"<<endl;
}
};
第3题:
下列程序中划线处正确的语句是( )。#include <iostream>using namespace std;class Base{public:void fun() { cout<<"Base:: fun"<<end1; }};class Derived: public Base{ void fun() { _______________________ //显试调用基类的函数 fun() cout <<"Derived:: fun"<<end1;};
A.fun();
B.Base. fun();
C.Base:: fun();
D.Base->fun();
第4题:
请将下列类定义补充完整。
class Base{public:void fun(){cout<<"Base∷fun"<<end1;}};
c1ass DehVed:public Base
{
public:
void fun(){
______ ∥显式调用基类的fun函数
cout<<"Derived∷fun"<<endl;
}
};
第5题:
应在下列程序画线处填入的正确语句是 ( )。 #include <iostream> using namespace std; clas Base { public: void fun() { cout<<"Base::fun"<<end1; } }; class Derived : public Base { void fun() { ________________//显示调用基类的函数 fun() cout<<"Derived::fun"<<end1; } };
A.fun();
B.Base.fun();
C.Base::fun();
D.Base->fun();