问题
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.
来源:https://stackoverflow.com/questions/9004370/what-is-the-difference-between-new-doublesomestring-and-double-parsedoublesom