A.publicintblipvert(intx){return0;}
B.privateintblipvert(intx){return0;}
C.privateintblipvert(longx){return0;}
D.protectedlongblipvert(intx,inty){return0;}
E.protectedintblipvert(longx){return0;}
F.protectedlongblipvert(longx){return0;}
G.protectedlongblipvert(intx){return0;}
第1题:
有如下程序: #include<iostream> using namespace std; class Base{ public: Base(int x=0){cout<<x;} }; class Derived:public Base{ public: Derived(int x=0){cout<<x;} private: Base val; }; int main( ){ Derived d(1); return 0; } 程序的输出结果是
A.0
B.1
C.01
D.001
第2题:
有如下程序: #inClude<iostream> using namespaCe std; Class Base{ publiC: Base(int x=0){Cout<<x;} }; Class Derived:publiC Base{ publiC: Derived(int X=0){Cout<<x;} private: Base val; }; int main { Derived d(1); return 0; } 执行这个程序的输出结果是( )。
A.0
B.1
C.01
D.001
第3题:
有如下程序:
include<iostream>
using namespace std;
int fun1(int x) {return++x;}
int fun2(int &x) {return++x;}
int main(){
int x=1,y=2;
y=fun 1(fun2(x));
cout<<X<<','<<y;
return 0:
}
程序的输出结果是______。
第4题:
有如下程序: #include<iostream> usingnamespacestd; classBase{ public: Base(intx=O){cout<<x;} }; classDerived:publicBase{ public: Derived(intx=O){cout<<x;}
private: Baseval; }; intmain(){ Derivedd(1); return0; } 程序执行后的输出结果是( )。
A.100
B.000
C.010
D.001
第5题:
给定java代码如下所示,在A处新增下列( )方法,是对cal方法的
重载
publicclassTest
{
publicvoidcal(intx,inty,intz)
{
}
//A
}
A.publicintcal(intx,inty,floatz){return0;}
B.publicintcal(intx,inty,intz){return0;}
C.publicvoidcal(intx,intz){}
D.publicviodcal(intz,inty,intx){}