You can use the Double.parseDouble() method to perform conversion.
Syntax:
Double.parseDouble(String类型变量)
Double.parseDouble(java.lang.String) can convert a numeric type string into a double type.
The parameters of Double.parseDouble(java.lang.String) can only be String.
(Video tutorial recommendation: java video)
For example, define String variable A as "10" and convert String into Double variable.
The specific code is as follows:
Recommended tutorial: Getting started with java development
The above is the detailed content of How to convert string to double type in java. For more information, please follow other related articles on the PHP Chinese website!