What is the difference between new Double(someStri

2019-06-20 18:01发布

问题:

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?

回答1:

One returns Double; the other, double.

The differences between primitive Java types and their wrapper counterparts are discussed, for example, here.