<tfoot id='sNUf9'></tfoot>

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

        <bdo id='sNUf9'></bdo><ul id='sNUf9'></ul>

        Double.parseDouble(String) 和 Double.valueOf(String) 有什么

        时间:2023-07-27

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

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

              <legend id='nr8Hn'><style id='nr8Hn'><dir id='nr8Hn'><q id='nr8Hn'></q></dir></style></legend>
                <tbody id='nr8Hn'></tbody>

                • <bdo id='nr8Hn'></bdo><ul id='nr8Hn'></ul>
                • 本文介绍了Double.parseDouble(String) 和 Double.valueOf(String) 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我想将 String 转换为 Double 数据类型.我不知道我应该使用 parseDouble 还是 valueOf.

                  I want to convert String to a Double data type. I do not know if I should use parseDouble or valueOf.

                  这两种方法有什么区别?

                  What is the difference between these two methods?

                  推荐答案

                  parseDouble 返回一个包含字符串值的原始双精度:

                  parseDouble returns a primitive double containing the value of the string:

                  返回一个新的 double,初始化为指定 String 表示的值,由 Double 类的 valueOf 方法执行.

                  Returns a new double initialized to the value represented by the specified String, as performed by the valueOf method of class Double.

                  valueOf 返回一个 Double 实例,如果已经缓存,你会得到相同的缓存实例.

                  valueOf returns a Double instance, if already cached, you'll get the same cached instance.

                  返回一个表示指定双精度值的 Double 实例.如果不需要一个新的 Double 实例,这个方法一般应该是优先于构造函数 Double(double) 使用,因为此方法可能会产生显着更好的空间和时间性能缓存频繁请求的值.

                  Returns a Double instance representing the specified double value. If a new Double instance is not required, this method should generally be used in preference to the constructor Double(double), as this method is likely to yield significantly better space and time performance by caching frequently requested values.

                  为避免创建新的 Double 对象实例的开销,您通常应该使用 valueOf

                  To avoid the overhead of creating a new Double object instance, you should normally use valueOf

                  这篇关于Double.parseDouble(String) 和 Double.valueOf(String) 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在Java中将字符转换为整数 下一篇:如何将 .txt 文件转换为 Hadoop 的序列文件格式

                  相关文章

                  最新文章

                  <legend id='qxB6J'><style id='qxB6J'><dir id='qxB6J'><q id='qxB6J'></q></dir></style></legend>

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

                        <bdo id='qxB6J'></bdo><ul id='qxB6J'></ul>

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

                      <tfoot id='qxB6J'></tfoot>