Java Convert String to Double

public class ConvertStringToDouble {
  public static void main(String[] args) {
    String aString = "78";
    double aDouble = Double.parseDouble(aString);
 
    System.out.println(aDouble);
  }
}

Post your Answer

  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Links to specified hosts will have a rel="nofollow" added to them.

More information about formatting options