• <small id='ddodn'></small><noframes id='ddodn'>

    <i id='ddodn'><tr id='ddodn'><dt id='ddodn'><q id='ddodn'><span id='ddodn'><b id='ddodn'><form id='ddodn'><ins id='ddodn'></ins><ul id='ddodn'></ul><sub id='ddodn'></sub></form><legend id='ddodn'></legend><bdo id='ddodn'><pre id='ddodn'><center id='ddodn'></center></pre></bdo></b><th id='ddodn'></th></span></q></dt></tr></i><div id='ddodn'><tfoot id='ddodn'></tfoot><dl id='ddodn'><fieldset id='ddodn'></fieldset></dl></div>

        <legend id='ddodn'><style id='ddodn'><dir id='ddodn'><q id='ddodn'></q></dir></style></legend>
        <tfoot id='ddodn'></tfoot>
          <bdo id='ddodn'></bdo><ul id='ddodn'></ul>

        如何对十进制数执行 Integer.parseInt()?

        时间:2023-10-01
      1. <i id='qHYC1'><tr id='qHYC1'><dt id='qHYC1'><q id='qHYC1'><span id='qHYC1'><b id='qHYC1'><form id='qHYC1'><ins id='qHYC1'></ins><ul id='qHYC1'></ul><sub id='qHYC1'></sub></form><legend id='qHYC1'></legend><bdo id='qHYC1'><pre id='qHYC1'><center id='qHYC1'></center></pre></bdo></b><th id='qHYC1'></th></span></q></dt></tr></i><div id='qHYC1'><tfoot id='qHYC1'></tfoot><dl id='qHYC1'><fieldset id='qHYC1'></fieldset></dl></div>

        <small id='qHYC1'></small><noframes id='qHYC1'>

          <tbody id='qHYC1'></tbody>

      2. <legend id='qHYC1'><style id='qHYC1'><dir id='qHYC1'><q id='qHYC1'></q></dir></style></legend>
              <bdo id='qHYC1'></bdo><ul id='qHYC1'></ul>

              1. <tfoot id='qHYC1'></tfoot>

                  本文介绍了如何对十进制数执行 Integer.parseInt()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  Java代码如下:

                  String s = "0.01";
                  int i = Integer.parseInt(s);
                  

                  但是这会引发 NumberFormatException... 可能出了什么问题?

                  However this is throwing a NumberFormatException... What could be going wrong?

                  推荐答案

                  0.01 不是整数(整数),所以你当然不能把它解析为一.请改用 Double.parseDoubleFloat.parseFloat.

                  0.01 is not an integer (whole number), so you of course can't parse it as one. Use Double.parseDouble or Float.parseFloat instead.

                  这篇关于如何对十进制数执行 Integer.parseInt()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Java int to String - Integer.toString(i) vs new Integer(i).to 下一篇:“int 不能被取消引用";在爪哇

                  相关文章

                  最新文章

                  1. <tfoot id='XPI5T'></tfoot>
                  2. <small id='XPI5T'></small><noframes id='XPI5T'>

                    1. <legend id='XPI5T'><style id='XPI5T'><dir id='XPI5T'><q id='XPI5T'></q></dir></style></legend>
                      <i id='XPI5T'><tr id='XPI5T'><dt id='XPI5T'><q id='XPI5T'><span id='XPI5T'><b id='XPI5T'><form id='XPI5T'><ins id='XPI5T'></ins><ul id='XPI5T'></ul><sub id='XPI5T'></sub></form><legend id='XPI5T'></legend><bdo id='XPI5T'><pre id='XPI5T'><center id='XPI5T'></center></pre></bdo></b><th id='XPI5T'></th></span></q></dt></tr></i><div id='XPI5T'><tfoot id='XPI5T'></tfoot><dl id='XPI5T'><fieldset id='XPI5T'></fieldset></dl></div>
                        <bdo id='XPI5T'></bdo><ul id='XPI5T'></ul>