g(3,2)
f(3)
a1.f(4)
a1.g(2,5)
第1题:
在C++语言中,若类C中定义了一个方法int f(int a,int b),那么方法(33)不能与该方法同时存在于类C中。
A.int f(int x,int y)
B.int f(float a,int b)
C.float f(mtx,float y)
D.int f(int x,float y)
第2题:
若有定义:int a=7;float x=2.5,y=4.7;则表达式x+a%3*(int)(x+y)%2/4的值是
A.2.500000
B.2.750000
C.3.500000
D.0.000000
第3题:
在C++语言中,若类C中定义了一个方法int (int a,int b),那么方法(1)不能与该方法同时存在于类C中。
A.int f(int x,int y)
B.int f(float a,int b)
C.float f(int x,float y)
D.int f(int x,float y)
第4题:
类testl定义如下: public class test1 { public float amethod(float a,float b){ } }
A.public foat amethod(float a,float b,foat c){ }
B.public float amethod(float c,float d){ }
C.public int amethod(int a,int b){ }
D.private float amethod(int a,int b,int c){ }
第5题:
若有定义:int a=4, b=5;float x=3.4,y=2.1;,则下列表达式的值为( )。 (float) (a+b)/2+(int)x%(int)y
A.5.5
B.55
C.5.5
D.55
第6题:
在下面的引用定义中,正确的是 ______。
A.int x,&y; y=x;
B.int x,&y=x;
C.int &y=x,x;
D.float z; int x,y=&z;
第7题:
以下正确的函数定义是______。
A.double f1(int x,int y)
B.double f1(int x;int y)
C.double f1(int x;float y)
D.double f1(int x,y)
第8题:
下面程序输出的结果是( )。 #include<iostream> using namespace std; int test(int n1,int n2) {return n1 +n2;} float test (int f1,float f2){return f1-f2;} float test(float x,float y){return(x+y)/2;} float test(float x,int y){return(x+y)*2;} void main(){ int a1=10; float a2=2.5f; cout<<test(a1,a2); }
A.12.5
B.7.5
C.6.25
D.25
第9题:
给定java代码如下所示,在A处新增下列()方法,是对cal方法的重载。public class Test { public void cal(int x, int y, int z) { } //A }
第10题:
下面的方法重载,正确的是()。
第11题:
若有定义:int a=2,b=3;floatx=3.5,y=2.5;则表达式(float)(a+b)/2+(int)x%(int)y的值是()
第12题:
int fun(int a, float b) { } float fun(int a, float b) { }
float fun(int a, float b) { } float fun(int x, float y) { }
float fun(float a) { } float fun(float a, float b) { }
float fun1(int a, float b) { } float fun2(int a, float b) { }
第13题:
若有定义:int a=4,b=5;float x=3.4,y=2.1;,则下列表达式的值为( )
(float) (a+b)/2+(int)×%(int)y
A.5.5
B.55
C.5.500000
D.55.00000
第14题:
类A定义如下: class A { private int x=10; int getx() { return x;} } class B extends A { private int x=15; //需要覆盖getx()方法 } 在下述方法中可以在类B中覆盖getx()方法的是 ( )
A.int getx(){…}
B.int getx(float f){…}
C.float getx(){…}
D.double getx(float f){…}
第15题:
若有定义:int x=1,y=2;float a=3.7,b=2.1;则(x+y)%2+(int)a/(int)b表达式的值为( )。
第16题:
A.3.5
B.3.0
C.2.5
D.2.0
第17题:
若有定义:“int a=4,b=5;float x=3.4,y=2.1;”,则下列表达式的值为( )。 (float)(a+b)/2+(int)x%(int)y;
A.5.5
B.55
C.5.500000
D.55.00000
第18题:
若有定义:int a=2,b=3;float x=3.5,y=2.5;则下面表达式的值为______。(float)(a+b)/2+(int)x%(int)y
A.3.5
B.35
C.3.5
D.35
第19题:
在C++语言中,若类C中定义了一个方法intf(int a,int b),那么方法不能与该方法同时存在于类C中。
A.int f(int x,int y)
B.int f(float a,int b)
C.float f(int x,float y)
D.int f(int x,float y)
第20题:
float x=26f; int y=26; int z=x/y; 以上语句能正常编译和运行。
第21题:
若有定义:int x=2,y=3;float i;则以下符合C语言语法的表达式是()
第22题:
若有定义 class A{int x,y; static float f(int a){…} float g(int x1,int x2){…}} 及A a1=new A( );则下列用法中非法的是( )。
第23题:
void setVar (int a, int b, float c){ x = a; y = b; z = c; }
public void setVar(int a, float c, int b) { setVar(a, b, c); }
public void setVar(int a, float c, int b) { this(a, b, c); }
public void setVar(int a, float b){ x = a; z = b; }
public void setVar(int ax, int by, float cz) { x = ax; y = by; z = cz; }