有如下类定义: class Test { public: Test(){a=0;c=0} //① int f(int a)const{this->a=a;} //② static int g(){return a;} //③ void h(int b){Test::b;}; //④ private: int a; static int b; const int C; }; int Test::b=0; 在标注号码的行中,能被正确编译的是()。
- 首页
- 消防工程师
-
1.有如下类定义: class Test { public: Test(){a=0;c=0} //① int f(int a)const{this->a=a;} //② static int g(){return
-
2.public class Test{public static void main(String args[]){Test d=new Test(); d.divide(4,0);}public void
-
3.考虑如下类: public class Test { int j,k; public Test(int j ) { this(j,0); } public Test(int j, int k) { this.j
-
4.下列程序运行结果是.class test{long x;static int num;public:test (long m=0){x=m;}test operator++();test operator
-
5.#include // 定义函数判断三个数是否能通过四则运算得到 0 int canGetZero(int a, int b, int c) { // 尝试所有可能的运算组合 if
-
6.有如下类声明:class XA
{ private:
int x;
public:
XA(int n){ x=n;}
};
class XB: public XA
{ private
-
7.下面关于函数的声明正确的是( ) ①int fun1(int x=0, int y); ②int fun2(int x=0, int y=0); ③int fun3(int x, y=0); ④int
-
8.以下定义语句中,错误的是( )。A、int a[]={1,2};B、char a[]={"test"};C、char s[10]={"test"};D、int n=5,a[n];
-
9.有如下类定义:class XA{int x;public:XA(int n) {x=n;}};class XB: public XA{int y; public:XB(int a,int b);};在构造函数
-
10.函数f定义如下,执行语句“sum=f(5)+f(3);”后,sum的值应为( )。