网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

11、在Java中,小数默认为double,如果要指定float类型请在小数后加F/f。


参考答案和解析
更多 “11、在Java中,小数默认为double,如果要指定float类型请在小数后加F/f。” 相关考题
考题 定义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是浮点数B、decimal是精确小数C、decimal和float都是精确小数

考题 下列哪个赋值语句是不正确的?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;

考题 下列关于Java语言简单数据类型的说法中,错误的是( )。A.float类型占内存少,运算快B.float类型占内存少,但是运算速度比不上double类型C.double类型精度高于float类型D.double类型在计算机的内存中占64位

考题 下面的说法中正确的是( )。 Ⅰ:有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是int型,f是int型,i是double型,则表达式10+a+i*f值的数据类型为A.int B.float C.double D.不确定

考题 设有定义nit a:float f; double int i,则表达式10+'a'+i+f值的数据类型是( )A.intB.floatC.doubleD.不确定

考题 下面程序执行后的输出结果是(小数点后只写一位)______。 main ( ) { double d; float f; long 1; int i; i=f=1=d=20/3; printf("%d %ld %f %f \n", i,l,f,d); }A.6 6 6.0 6.0B.6 6 6.7 6.7C.6 6 6.0 6.7D.6 6 6.7 6.0

考题 设变量a是int型,f是float型,i是double型,则表达式10+′a′+i*f值的数据类型为A.int B.float C.double D.不确定

考题 以下正确的函数定义是______。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)

考题 下列JAVA语句中,错误的一项是()A、int $e,a,b =10;B、char c,d ='a';C、float e=0.0d;D、double e=0.0f;

考题 有下列程序 main() { double d;float f;long l;int i; i=f=1=d=20/3; printf("%d%1d %f %f\n",i,1,f,D) ; } 程序运行后的输出结果是(小数点后只写1位)( )A.6 6 6.0 6.0B.6 6 6.7 6.7C.6 6 6.0 6.7D.6 6 6.7 6.0

考题 ()函数将字符型数据(整数或小数)转换成浮点数类型的数值(即小数)。A、input()B、float()C、int()D、print()

考题 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; }

考题 在Java中,下列()是合法的声明。     A、float f=1/3;B、int i=1/3;C、float f=1.01;D、double d=999d;

考题 变量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

考题 在计量过程中,F值,K值均应保留到小数点后第()位。

考题 “图书”表中价格列是一个定点小数,小数点前3位,小数点后保留1位,正确的类型是()A、numeric(3,1)B、numeric(4,1)C、numeric(5,1)D、float

考题 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?()        A、 Void setVar(float f) {x = f;}B、 Public void setVar(int f) {x = f;}C、 Public void setVar(float f) {x = f;}D、 Public double setVar(float f) {x = f;}E、 Public final void setVar(float f) {x = f;}F、 Protected float setVar() {x=3.0f; return 3.0f; }

考题 单选题以下关于表列数据类型的描述中,()是正确的。A float是浮点数。B decimal是精确小数。C decimal和float都是精确小数。

考题 单选题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; }

考题 多选题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?()AVoid setVar(float f) {x = f;}BPublic void setVar(int f) {x = f;}CPublic void setVar(float f) {x = f;}DPublic double setVar(float f) {x = f;}EPublic final void setVar(float f) {x = f;}FProtected float setVar() {x=3.0f; return 3.0f; }

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

考题 单选题变量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

考题 多选题class BaseClass{   private float x= 1.0f;   protected void setVar (float f) {x = f;}   }   class SubClass exyends BaseClass {   private float x = 2.0f;   //insert code here  8. }   Which two are valid examples of method overriding?()AVoid setVar(float f) {x = f;}BPublic void setVar(int f) {x = f;}CPublic void setVar(float f) {x = f;}DPublic double setVar(float f) {x = f;}EPublic final void setVar(float f) {x = f;}FProtected float setVar() {x=3.0f; return 3.0f; }