变量x、f、d分别为int,float,double类型的,除了f和d不能等于无穷大和NAN以外值可以任意选取,下面表达式为真的是()
第1题:
设变量a是int型,f是float型,i是double型,则表达式10+'a'+i*f的值的数据类型为( )。
A.int
B.float
C.double
D.不确定
第2题:
设变量a是int型,f是double型,i是float型,则表达式10+'a'+i * f值的数据类型是
A.int
B.float
C.double
D.不确定
第3题:
下面的说法中正确的是( )。 Ⅰ:有float型数据定义float f1=100.00f;Float F1=new float(f1),要把float型转换为double型时用Double d1=F1.doubleValue()。 Ⅱ:有double型数据定义double d1=100.00;Double D1=new Double(d1),要把double型转换为int型时用 int il=D1.intValue()。 Ⅲ:当把int型转换为double型时,该转换是不能自动转换的,需要强制类型转换。 Ⅳ:以上说法都不对。
A.Ⅱ、Ⅲ
B.Ⅰ、Ⅲ
C.Ⅰ、Ⅱ
D.Ⅳ
第4题:
设变量a是int型,f是int型,i是double型,则表达式10+a+i*f值的数据类型为A.int B.float C.double D.不确定
第5题:
设变量a是int型,f是float型,i是double型,则表达式10+′a′+i*f值的数据类型为A.int B.float C.double D.不确定
第6题:
以下正确的函数定义是______。
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)
第7题:
在同一可访问区内有如下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.④⑧构成重载
第8题:
若有说明:char w; int x; float y; double z; 则表达式w*x+y-z的值的数据类型是()。
第9题:
switch(表达式)语句中的“表达式”,允许的类型是()。
第10题:
class BaseClass{ private float x= 1.0f; protected void setVar (float f) {x = f;} } class SubClass extends BaseClass { private float x = 2.0f; //insert code here } Which two are valid examples of method overriding?()
第11题:
Void setVar(float f) {x = f;}
Public void setVar(int f) {x = f;}
Public void setVar(float f) {x = f;}
Public double setVar(float f) {x = f;}
Public final void setVar(float f) {x = f;}
Protected float setVar() {x=3.0f; return 3.0f; }
第12题:
Void setVar(float f) {x = f;}
Public void setVar(int f) {x = f;}
Public void setVar(float f) {x = f;}
Public double setVar(float f) {x = f;}
Public final void setVar(float f) {x = f;}
Protected float setVar() {x=3.0f; return 3.0f; }
第13题:
设变量a是 int 型,f是 double 型,i是 float 型,则表达式10+'a'+i*f值的数据类型
A.int
B.float
C.double
D.不确定
第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题:
在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)
第16题:
A.1.unsigned,2.int,3.double
B.1.double,2.double,3.double
C.1.int,2.double,3.char
D.1.unsigned,2.double,3.int
第17题:
设有以下变量定义,并已赋确定的值: char w; int x; float y; double z; 则表达式:w*x+z-y所求得的数据类型为( )。
A.char
B.int
C.float
D.double
第18题:
若有以下定义:
char a;int b;
float c;double d;
则表达式a*b+d-c值的类型为( )。
A.A. float
B.int
C.char
D.double
第19题:
有以下程序: #include <stdio.h> main() { int a; char c=10; float f=100.0; double x; a=f/=c*=(x=6.5); printf("%d%d%3.1f%3.1f\n",a,c,f,x); } 程序运行后的输出结果是( )。
A.1 65 1 6.5
B.1 65 1.5 6.5
C.1 65 1.0 6.5
D.2 65 1.5 6.5
第20题:
设有说明:char w;int x;float y;double z;则表达式w*x+z-y 值的数据类型为().
第21题:
假定变量x,f和d的类型分别为int 、float和double。下面表达式的值总是为1的是()
第22题:
x==(int)(double)x
x==(int)(float)x
d==(double)(float)d
(f+d)-f==d
第23题:
x==(int)(float)x
d==(double)(float)d
f==(float)(double)f
(f+d)-f==d