public static java.lang.Double valueOf(java.lang.String s) throws java.lang.NumberFormatException {
  return new Double(parseDouble(s));
}

public static java . lang . Double valueOf ( java . lang . String s ) throws java . lang . NumberFormatException { return new Double ( parseDouble ( s ) ) ; }
returns a new double object initialized to the value represented by the specified string . the string s is interpreted as the representation of a floating - point value and a double object representing that value is created and returned . if s is null , then a nullpointerexception is thrown . leading and trailing whitespace characters in s are ignored . the rest of s should constitute a floatvalue as described by the lexical rule : where and are as defined in section 3 . 10 . 2 of the . if it does not have the form of a , then a numberformatexception is thrown . otherwise , it is regarded as representing an exact decimal value in the usual " computerized scientific notation " ; this exact decimal value is then conceptually converted to an " infinitely precise " binary value that is then rounded to type double by the usual round - to - nearest rule of ieee 754 floating - point arithmetic . finally , a new object of class double is created to represent the double value .
