单选题Which of the following assignment is not correct?()A float f = 11.1;B double d = 5.3E12;C double d = 3.14159;D double d = 3.14;.

单选题
Which of the following assignment is not correct?()
A

 float f = 11.1;

B

 double d = 5.3E12;

C

 double d = 3.14159;

D

 double d = 3.14;.


参考解析

解析: 浮点数的赋值是带有小数点的数字缺省是double型的,如果在浮点数后面加f或者F则是float,后面加d或者D则是double,科学计数法形式的浮点数也是double型的,而double的精度比float高,将一个高精度的double赋值给一个低精度的float时需要进行强制类型转换,反之则不需要。

相关考题:

Which of the following depreciation methods provides for accelerated depreciation of an asset:A . Double declining balance.B . Straight line.C . Exponential depreciationD . Double sum of the years digitsE . Double increasing balance

定义int a; float f; double i; 表达式 15+i*f+ˊAˊ的值是 _______ 。 A.floatB. intC. charD. double

下列赋值语句中,不合法的是( )。 A.float f=1.2B.float f2=1.2fC.double d=1.2D.double d2=1.2f

下列哪个赋值语句是不正确的?A.float f=11.1;B.double d=5.3E12;C.float d=3.14f;D.double f=11.1E10f;

下列的哪个赋值语句是不正确的? ( )A.float f=11.1;B.double d=5.3E12;C.float d=3.14f;D.double f=11.1E10f;

下列赋值语句中错误的是( )。A.float f=1f;B.double d=5.3E12;C.char c='\r';D.byte bb=433;

下面的说法中正确的是( )。 Ⅰ:有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.Ⅳ

下面赋值语句不正确的是( )。A.float f=11.1;B.double d=5.3E12;C.double d=3.14159;D.double d=3.14D;

下列赋值语句中错误的是( )。A.float f=11.1fB.double d=5.3e12;C.char f='\r';D.byte bb=433;

以下正确的函数定义是______。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个函数:①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.④⑧构成重载

下列赋值语句中错误的是( )。A.float f=11.1f;B.double d=5.3E12;C.char c='r';D.byte bb=433;

1. class Super {  2. public float getNum() { return 3.0f; }  3. }  4.   5. public class Sub extends Super {  6.   7. }  Which method, placed at line6, causes compilation to fail?()  A、 public void getNum(){}B、 public void getNum(double d){}C、 public float getNum() { return 4.0f; }D、 public double getNum(float d) { return 4.0d; }

class super {   public float getNum() {return 3.0f;}   }   public class Sub extends Super {   }   Which method, placed at line 6, will cause a compiler error?()A、 Public float getNum() {return 4.0f; }B、 Public void getNum (){}C、 Public void getNum (double d){}D、 Public double getNum (float d) {retrun 4.0f; }

Which of the following assignment is not correct?()         A、 float f = 11.1;B、 double d = 5.3E12;C、 double d = 3.14159;D、 double d = 3.14;.

变量x、f、d分别为int,float,double类型的,除了f和d不能等于无穷大和NAN以外值可以任意选取,下面表达式为真的是()A、x==(int)(double)xB、x==(int)(float)xC、d==(double)(float)dD、(f+d)-f==d

假定变量x,f和d的类型分别为int 、float和double。下面表达式的值总是为1的是()A、x==(int)(float)xB、d==(double)(float)dC、f==(float)(double)fD、(f+d)-f==d

下面的哪个赋值语句是不对的?()A、float f=11.1;B、double d=5.3E12;C、double d=3.14159;D、double d=3.14D;

1. class super {  2. public float getNum() {return 3.0f;}  3. }  4.    5. public class Sub extends Super { 6.   7. }   Which method, placed at line 6, will cause a compiler error?()  A、  Public float getNum()   {return 4.0f; }B、  Public void getNum ()  { }C、  Public void getNum (double d)   { }D、  Public double getNum (float d) {retrun 4.0f; }

Which of the following statements are legal?()         A、 long l = 4990;B、 int i = 4L;C、 float f = 1.1;D、 double d = 34.4;E、 double t = 0.9F;

单选题变量x、f、d分别为int,float,double类型的,除了f和d不能等于无穷大和NAN以外值可以任意选取,下面表达式为真的是()Ax==(int)(double)xBx==(int)(float)xCd==(double)(float)dD(f+d)-f==d

单选题下面的哪个赋值语句是不对的?()Afloat f=11.1;Bdouble d=5.3E12;Cdouble d=3.14159;Ddouble d=3.14D;

单选题class super {   public float getNum() {return 3.0f;}   }   public class Sub extends Super {   }   Which method, placed at line 6, will cause a compiler error?()A Public float getNum() {return 4.0f; }B Public void getNum (){}C Public void getNum (double d){}D Public double getNum (float d) {retrun 4.0f; }

单选题设有定义:char c;float f;int i;unsignedu;double d;下列各表达式的类型分别是()1.u+92.d!=f(i+2)3.8.2*i+cA1.unsigned,2.int,3.doubleB1.double,2.double,3.doubleC1.int,2.double,3.charD1.unsigned,2.double,3.int

单选题1. class Super {  2. public float getNum() { return 3.0f; }  3. }  4.   5. public class Sub extends Super {  6.   7. }  Which method, placed at line6, causes compilation to fail?()A public void getNum(){}B public void getNum(double d){}C public float getNum() { return 4.0f; }D public double getNum(float d) { return 4.0d; }

单选题假定变量x,f和d的类型分别为int 、float和double。下面表达式的值总是为1的是()Ax==(int)(float)xBd==(double)(float)dCf==(float)(double)fD(f+d)-f==d

单选题Which of the following assignment is not correct?()A float f = 11.1;B double d = 5.3E12;C double d = 3.14159;D double d = 3.14;.

单选题1. class super {  2. public float getNum() {return 3.0f;}  3. }  4.    5. public class Sub extends Super { 6.   7. }   Which method, placed at line 6, will cause a compiler error?()A  Public float getNum()   {return 4.0f; }B  Public void getNum ()  { }C  Public void getNum (double d)   { }D  Public double getNum (float d) {retrun 4.0f; }