Double.parseDouble(String)
will return a primitive double
type.
Double.valueOf(String)
will return a wrapper object of type Double
.
So, for e.g.:
double d = Double.parseDouble("1");
Double d = Double.valueOf("1");
Moreover, valueOf(...)
is an overloaded method. It has two variants:
Whereas parseDouble
is a single method with the following signature: