double d = Integer.parseInt("-23.1"); 

解决方案 »

  1.   

    不知怎么回事,我用 java 以后好像再也没有用过 float 这种变量类型。
      

  2.   

    上边的错了float d = Float.parseFloat("-23.1"); 
      

  3.   

    to hexiaofeng(java爱好者):
    哪里错了!
      

  4.   

    楼上的那位,hexiaofeng(java爱好者)没说你,他指的是他自己的double d = Integer.parseInt("-23.1"); 写错了
      

  5.   

    java.text.DecimalFormat
    可以帮你解决String<=>Number之间的一切.
      

  6.   

    double d = Double.valueOf( "-21.3" );