类Test定义如下,将下列哪个方法插入③行处是不合法的( )?
① public class Test{
② public float Method(float a,float B) { }
③ ______
④ }
A.public float Method(float a,float b,float C) { }
B.public float Method(float c,float d){ }
C.public int Method(int a,int B) { }private float Method(int a,int b,int C) { }
D.private float Method(int a,int b,int C) { }
第1题:
类Test定义如下,将下列哪个方法插入③行处是不合法的? ① public class Test { ② public float Method(float a,float b) { } ③ ④ }
A.public float Method(float a,float b,float c) { }
B.public float Method(float c,float d){ }
C.public int Method(int a,int b){ }
D.private float Method(int a,int b,int c){ }
第2题:
有如下类定义: 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=b;}; //④ private: int a; static int b; const int c; }; int Test::b=0; 在标注号码的行中,能被正确编译的是
A.①
B.②
C.③
D.④
第3题:
类Test定义如下,将下列()方法插入③行处是不合法的。①publicclassTest{②publicfloatMethod(floata,floatb){}③④}
A.publicfloatMethod(floata,floatb,floatc){}
B.pubicfloatMethod(floatc,floatd){}
C.publicintMethod(inta,intb){}
D.pivatefloatMethod(inta,intb,intc){}
第4题:
有如下类定义: 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; 在标注号码的行中,能被正确编译的是( )。
A.①
B.②
C.③
D.④
第5题:
类Test定义如下,将下列( )方法插入③行处是不合法的。 ①publicClass Test{ ②public float Method(floatA,float b){} ③ ④}
A.public float Method(floatA,float b,floatC){}
B.public float Method(noatC,float d) {}
C.public int Method(intA,int b){}
D.private float Method(intA,int b,intC){}
第6题:
类Test定义如下,将下列哪个方法插入③行处是不合法的? ( ) ①public class Test { ②public float Method(float a,float b){} ③ ④}
A.public float Method(float a,float b,float c){}
B.public float Method(float c,float d){}
C.public int Method(int a,int b){}
D.private float Method(int a,int b,int c){}
第7题:
类Test定义如下,将下列______方法插入③行处是不合法的。 ( )①public class Test{②public float Method(float a,float b){}③④}
A.public float Method(float a,float b,float c){}
B.public float Method(float c,float d){}
C.public int Method(int a,int b){}
D.private float Method(int a,int b,int c){}
第8题:
有如下程序:#include<iostream>using namespace std;class test{private: int a;public: test(){cout<<"constructor"<<endl;} test(int a){cout<<a<<endl;} test(const test&_test) { a=_test.a; cout<<"copy constructor"<<en+dl; } ~test(){cout<<"destructor"<<endl;}};int main(){ test A(3); rerun 0;}运行时输出的结果是
A.3
B.constructor destructor
C.copy constructor destructor
D.3 destructor
第9题:
有如下类定义:
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 = b;}; // ④
private:
int a;
static int b;
const int c;
};
int Test::b = 0;
在标注号码的行中,能被正确编译的是
A . ①
B . ②
C . ③
D . ④