AP® Computer Science A glossary

Double (class)

Also called: Double

Course: AP® Computer Science A Shows up in: Unit 4: Data Collections

The java.lang wrapper class whose immutable objects hold one double value; Double.parseDouble(s) returns a String as a double.

Appears in the course and exam description (CED): 4.7.A.14.7.A.24.7.A.34.7.A.5

Not to be confused with the primitive type double. A Double is an object; a double is a plain value.

Double price = Double.parseDouble("4.5");
double total = price * 2;
System.out.println(total);

Output:

9.0
Learn it properly, with a checkpoint 4.7 Wrapper Classes

Related terms

Was this page helpful?

No names are ever shown, and every public comment is checked by us first. Please do not include personal details. To get a reply, email [email protected].

↑ Top

Enlarged view of the selected figure