Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between new Double(someString) and 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?

like image 207
ubiquibacon Avatar asked Jan 25 '12 14:01

ubiquibacon


1 Answers

One returns Double; the other, double.

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

like image 50
NPE Avatar answered Sep 24 '22 07:09

NPE