methodA(byte x,double y){return (short)x/y*2;}下划线上应填写的关键字是( )。
A、byte
B、double
C、short
D、float
第1题:
下列函数值的类型是( )。 fun(double x) { float y; y=3*x-4; return y; }
A.int
B.不确定
C.void
D.float
第2题:
自动类型转换规定的优先次序是( )。
A.short,byte,char→long→int→float→double
B.short,byte,char→int→long―float→double
C.byte,short,char→long→int→float→double
D.byte,short,char→int→long→float→double
第3题:
自动类型转换是按优先关系从低级数据转换成高级数据,规定的优先次序是( )。
A.byte,short,char→int→long→float→double
B.float→int→long→byte,short,char→double
C.int→long→float→double←byte,short,char
D.double→int→folat→long→byte,short,char
第4题:
A.byte, short, int, long, float, double
B.boolean, byte, short, char, int, long, float, double
C.byte, short, char, int, long, float, double
D.byte, short, char
E.int, long, float, double
第5题:
有以下方法的定义,请选择该方法的返回类型()。ReturnType method(bytex,doubley){return(short)x/y*2;}
第6题:
有以下方法的定义,请选择该方法的返回类型()。 ReturnType method(byte x, double y){ return (short)x/y*2;}
第7题:
如果定义有double,x;float,y;int,m,则表达式x*y-m的类型为()
第8题:
1. public class returnIt ( 2. returnType methodA(byte x, double y) ( 3. return (short) x/y * 2; 4. ) 5. ) What is the valid returnType for methodA in line 2?()
第9题:
public class returnIt ( returnType methodA(byte x, double y) ( return (short) x/y * 2; ) ) What is the valid returnType for methodA in line 2?()
第10题:
Int
Byte
Long
Short
Float
Double
第11题:
int
byte
long
short
float
double
第12题:
Int
Byte
Long
Short
Float
Double
第13题:
下列函数的类型是( )。
fun(double x) { float y;y=3*x-4;return y; }
A.int
B.不确定
C.void
D.float
第14题:
在同一可访问区内有如下8个函数:
①double calculate(double x)
②double calculate(double x, double y);
③double calculate(double x. int y);
④double calculate(int x, double y);
⑤double calculate(int x);
⑥float calculate(float x);
⑦float calculate(double x);
⑧float calculate(int x,double y)。
那么关于函数重载的说法中,不正确的是(63)。
A.②③④⑤中任两个函数均构成重载
B.①③构成重载
C.②⑧肯定构成重载,⑥⑦也肯定构成重载
D.④⑧构成重载
第15题:
假设有函数模板定义如下,下列各选项中正确的是( )。 Template <class T> T Max(T a,T b,T c) { if(a<b) {if(b<c) return c; else return b;} else {if(a<c) return c; else return a;} }
A.float x,y,z;float max;max=Max(x,y,z);
B.float x;int y,z;float max;max=Max(x,y,z);
C.float x;double y,z;float max;max=Max(x,y,z);
D.三个选项都正确
第16题:
(12)有以下程序,请在 【12】 处填写正确语句,使程序可正常编译运行。
#include <stdio.h>
【12】 ;
main()
{ double x,y,(*p)();
scanf("%lf%lf",&x,&y);
p=avg;
printf("%f\n",(*p)(x,y));
}
double avg(double a,double b)
{ return((a+b)/2);}
第17题:
1. public class ReturnIt { 2. return Type methodA(byte x, double y) { 3. return (long)x / y * 2; 4. } 5. } What is the narrowest valid returnType for methodA in line2?()
第18题:
______methodA(bytex,doubley){?return(short)x/y*2;?}下划线上应填写的关键字是()
第19题:
有以下方法的定义,ReturnTypemethod(bytex,floaty){return(short)x/y*2;}请选择该方法的返回类型()。
第20题:
1. public class ReturnIt { 2. return Type methodA(byte x, double y) { 3. return (short)x / y * 2; 4. } 5. } What is the narrowest valid returnType for methodA in line2?()
第21题:
byte
double
short
float
第22题:
byte
short
int
double
第23题:
int
byte
long
short
float
double