类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){}
第1题:
有如下类定义: 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.④
第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定义如下,将下列哪个方法插入③行处是不合法的? ① 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){ }
第4题:
类Test定义如下,将下列()方法插入③行处是不合法的。①publicclassTest{②publicfloatMethod(floata,floatb){}③④}
A.publicfloatMethod(floata,floatb,floatc){}
B.pubicfloatMethod(floatc,floatd){}
C.publicintMethod(inta,intb){}
D.pivatefloatMethod(inta,intb,intc){}
第5题:
类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) { }