ICSE Class 10 Computer Applications Question 8 of 16

Library Classes — Question 8

Back to all questions
8
Question

Question 6

How do you convert a numeric string into a double value?

Answer

The wrapper class Double has a method parseDouble() which is used to parse a numeric string into a double value.

Syntax:

Double.parseDouble(String s);

Example:

String str = "437246.643";
double d = Double.parseDouble(str);