Skip to content
Marlbridge

AP® Computer Science A · Unit 4 · Topic 4.7

Wrapper Classes: Checklist (Computer Science A 4.7)

A self-check for wrapper classes: autoboxing, unboxing, immutability, parsing Strings to numbers, and predicting compile and run-time problems with Integer and Double.

Tick each line when you can do it without looking at the guide. Each line names where it is taught and tested. Revisit the study guide for anything you cannot yet do.

Understanding

  • ☐ I can explain why Java has wrapper classes and give the example of ArrayList (study guide: Why a primitive needs a wrapper).
  • ☐ I can state that Integer and Double are immutable and what that means for n++ (study guide: Other behaviours to know; practice: Question 5).
  • ☐ I can say which package holds Integer and Double and that no import is needed (study guide: Why a primitive needs a wrapper).
  • ☐ I can distinguish autoboxing from unboxing (practice: Question 1).

Skills

  • ☐ I can trace code that mixes int, Integer, double and Double and give each final value (study guide: Worked example 1; practice: Question 8).
  • ☐ I can use Integer.parseInt and Double.parseDouble to turn Strings into numbers (study guide: Turning a String into a number; practice: Questions 3 and 7).
  • ☐ I can write a method that parses an array of Strings and sums or averages it (study guide: Worked example 2; practice: Questions 9 and 10).
  • ☐ I can predict the result of integer division on Integer objects (practice: Question 2).

Reasoning

  • ☐ I can predict which declarations do not compile, such as Double d = 7; (practice: Question 4).
  • ☐ I can predict when a NumberFormatException is thrown (study guide: Turning a String into a number; practice: Question 10).
  • ☐ I can predict a NullPointerException from unboxing null (practice: Question 6).
  • ☐ I can explain why == is unreliable for comparing wrapper objects and what to use instead (study guide: Other behaviours to know).

Next: Topic 4.8 ArrayList methods.

AP® and Advanced Placement® are trademarks registered by the College Board, which is not affiliated with, and does not endorse, this website. Marlbridge is an independent tuition provider. It is not an authorized AP course provider, an AP school or an exam centre, and these resources are not official College Board materials. Reading them or doing simulations does not meet the laboratory requirement of an AP science course.