AP® Computer Science A glossary

Widening

Course: AP® Computer Science A Shows up in: Unit 1: Using Objects and Methods

The automatic conversion of an int value to a double value, such as when an int is stored in a double variable.

Appears in the course and exam description (CED): 1.5.A.3

Some code causes int values to be automatically cast (widened) to double: storing an int in a double variable, passing an int argument to a double parameter, or mixing them in an expression.

double d = 7;
System.out.println(d);

Output:

7.0
Learn it properly, with a checkpoint 1.5 Casting and Range of Variables

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