新的Double(someString)和Double.parseDouble(someString)之间有什么区别? [英] What is the difference between new Double(someString) and Double.parseDouble(someString)
本文介绍了新的Double(someString)和Double.parseDouble(someString)之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
据我所知,新的Double(someString)和 Double.parseDouble(someString)
给我完全相同的结果。有没有理由要使用另一个?
As far as I can tell new Double(someString)
and Double.parseDouble(someString)
give me the exact same result. Is there any reason I would want to use one over the other?
推荐答案
一个返回 Double
;另一个 double
。
讨论了原始Java类型与其包装器对应方之间的区别,例如< a href =http://docs.oracle.com/javase/tutorial/java/data/numberclasses.html>这里。
The differences between primitive Java types and their wrapper counterparts are discussed, for example, here.
这篇关于新的Double(someString)和Double.parseDouble(someString)之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文