Java Double.valueOf(String s)
Syntax
Double.valueOf(String s) has the following syntax.
public static Double valueOf(String s) throws NumberFormatException
Example
In the following code shows how to use Double.valueOf(String s) method.
The following code tries to convert "1.234"
to double type.
public class Main {
public static void main(String[] args) {
// ww w.j a v a2 s . com
System.out.println(Double.valueOf("1.234"));
}
}
The output: