网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
float[]f=newfloat[10],则f[0]的值为()
A
0.0
B
0.0f
C
null
D
false
参考答案
参考解析
解析:
暂无解析
更多 “单选题float[]f=newfloat[10],则f[0]的值为()A 0.0B 0.0fC nullD false” 相关考题
考题
publicclassTest{privatestaticfloat[]f=newfloat[2];publicstaticvoidmain(Stringargs[]){System.out.println(f[0]=+f[0]);}}Whatistheresult?()
A.f[0]=0B.f[0]=0.0C.Compilationfails.D.Anexceptionisthrownatruntime.
考题
floatf[][][]=newfloat[3][][];floatf0=1.0f;float[][]farray=newfloat[1][1];Whatisvalid?()
A.f[0]=f0;B.f[0]=farray;C.f[0]=farray[0];D.f[0]=farray[0][0];
考题
publicclassArrayTest{publicstaticvoidmain(String[]args){floatfl[],f2[];fl=newfloat[10];f2=f1;System.out.println(f2[0]=+f2[0]);}}Whatistheresult?()
A.Itprintsf2[0]=0.0.B.Itprintsf2[0]=NaN.C.Anerroratline5causescompiletofail.D.Anerroratline6causescompiletofail.E.Anerroratline6causesanexpectationatruntime.
考题
Whichtwocauseacompilererror?()
A.float[]=newfloat(3);B.floatf2[]=newfloat[];C.float[]f1=newfloat[3];D.floatf3[]=newfloat[3];E.floatf5[]={1.0f,2.0f,2.0f};F.floatf4[]=newfloat[]{1.0f.2.0f.3.0f};
考题
publicclassArrayTest{publicstaticvoidmain(Stringargs){floatf1,f2;f1=newfloat[10];f2=f1;System.out.printIn(f2[0]=”+f2[0]);}}Whatistheresult?()
A.Itprintsf2[0]=0.0B.Itprintsf2[0]=NaNC.Anerroratline5causescompiletofail.D.Anerroratline6causescompiletofail.E.Anerroratline6causesanexceptionatruntime.
考题
public class ArrayTest { public static void main (Stringargs) { float f1, f2; f1 = new float [10]; f2 = f1; System.out.printIn (“f2[0]=” + f2[0]); } } What is the result?()A、 It prints f2[0] = 0.0B、 It prints f2[0] = NaNC、 An error at line 5 causes compile to fail.D、 An error at line 6 causes compile to fail.E、 An error at line 6 causes an exception at runtime.
考题
public static void parse(String str) { try { float f= Float.parseFloat(str); } catch (NumberFormatException nfe) { f= 0; } finally { System.out.println(f); } } public static void main(String[] args) { parse(”invalid”); } What is the result?() A、 0.0B、 Compilation fails.C、 A ParseException is thrown by the parse method at runtime.D、 A NumberFormatException is thrown by the parse method at runtime.
考题
float f[][][] = new float[3][][]; float f0 = 1.0f; float[][] farray = new float[1][1]; What is valid?() A、 f[0] = f0;B、 f[0] = farray;C、 f[0] = farray[0];D、 f[0] = farray[0][0];
考题
假定变量x,f和d的类型分别为int 、float和double。下面表达式的值总是为1的是()A、x==(int)(float)xB、d==(double)(float)dC、f==(float)(double)fD、(f+d)-f==d
考题
1. public class ArrayTest { 2. public static void main (String[]args) { 3. float f1[], f2[]; 4. f1 = new float [10]; 5. f2 = f1; 6. System.out.printIn (“f2[0]=” + f2[0]); 7. } 8. } What is the result?() A、 It prints f2[0] = 0.0B、 It prints f2[0] = NaNC、 An error at line 5 causes compile to fail.D、 An error at line 6 causes compile to fail.E、 An error at line 6 causes an exception at runtime.
考题
单选题类Teacher: class Teacher{ String name; float salary; Teacher(String name){ this.name = name; } Teacher(String name,float salary){ this.name = name; this.salary = salary; } } 执行语句Teacher t = new Teacher(“Tom”,2000.0f);后,字段salary的值是哪一项?()A
2000.0fB
0.0fC
null;D
2000
考题
单选题1. public class ArrayTest { 2. public static void main (String[]args) { 3. float f1[], f2[]; 4. f1 = new float [10]; 5. f2 = f1; 6. System.out.printIn (“f2[0]=” + f2[0]); 7. } 8. } What is the result?()A
It prints f2[0] = 0.0B
It prints f2[0] = NaNC
An error at line 5 causes compile to fail.D
An error at line 6 causes compile to fail.E
An error at line 6 causes an exception at runtime.
考题
单选题假定变量x,f和d的类型分别为int 、float和double。下面表达式的值总是为1的是()A
x==(int)(float)xB
d==(double)(float)dC
f==(float)(double)fD
(f+d)-f==d
考题
单选题public static void parse(String str) { try { float f= Float.parseFloat(str); } catch (NumberFormatException nfe) { f= 0; } finally { System.out.println(f); } } public static void main(String[] args) { parse(”invalid”); } What is the result?()A
0.0B
Compilation fails.C
A ParseException is thrown by the parse method at runtime.D
A NumberFormatException is thrown by the parse method at runtime.
考题
单选题float f[][][] = new float[3][][]; float f0 = 1.0f; float[][] farray = new float[1][1]; What is valid?()A
f[0] = f0;B
f[0] = farray;C
f[0] = farray[0];D
f[0] = farray[0][0];
考题
单选题public class ArrayTest { public static void main (Stringargs) { float f1, f2; f1 = new float [10]; f2 = f1; System.out.printIn (“f2[0]=” + f2[0]); } } What is the result?()A
It prints f2[0] = 0.0B
It prints f2[0] = NaNC
An error at line 5 causes compile to fail.D
An error at line 6 causes compile to fail.E
An error at line 6 causes an exception at runtime.
热门标签
最新试卷