Which of the following statements converts a String object named subtotalString to a double variable named subtotal?a.double subtotal = Double.toString(subtotalString);b.double subtotal = subtotalString.parseDouble;c.double subtotal = Double.parseDouble(subtotalString);d.double subtotal = (double) subtotalString

Respuesta :

Answer:

double subtotal = Double.parseDouble(subtotalString);

Explanation:

Required

Determine which method converts string object to double variable

From the question;

The string object is: subtotalString

The double variable is: subtotal

From the given options (a) to (d), the option that answers the question is:

double subtotal = Double.parseDouble(subtotalString);

And it follows the syntax:

[datatype] [variable-name] = [Data-type].parse[Datatype]([string-variable])