请将下列类定义补充完整。
class Base{public:void fun(){tout<<"Base::fun"<<endl;}};
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题:
下列程序划线处应填入的正确语句是()。 class Base { public: void fun(){ cout<<"Base::fun"<<endl; } }; class Derived:public Base { public: void fun() { _____________ //显示调用基类的函数fun() cout<<"Derived::fun"<<endl; } };
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题:
8、应在下列程序划线处填入的正确语句是()。 class Base { public: void fun(){cout<<"Base::fun"<<endl;} }; class Derived:public Base { void fun() {_____________ //显示调用基类的函数fun() cout<<"Derived::fun"<<endl; } };
A.fun();
B.Base.fun();
C.Base::fun();
D.Base->fun();