AP® Computer Science A glossary

Wrapper class

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

A class whose objects hold one primitive value; for the AP® exam, Integer wraps an int and Double wraps a double.

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

Wrapper classes are in java.lang and their objects are immutable. They let primitive values be used where an object is required, such as in an ArrayList<Integer>. The compiler converts automatically with autoboxing and unboxing.

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