Using Objects and Methods
What this unit covers
The topics below follow the published CS A course framework for Unit 1. This unit is worth 15–25% of the exam, so budget your time against that rather than against how long the unit takes to teach.
Lessons in this unit
- Objects & Classes13 min · 3 objectivesDistinguish a class (the blueprint) from an object (an instance built from it) · Create an object with the `new` keyword and a constructor · Call a method on an object using dot notation to read its state
- Method Calls14 min · 3 objectivesDifferentiate methods that return a value from `void` methods that do not · Pass arguments to a method and predict the returned result · Chain method calls, evaluating them left to right
- String Methods14 min · 3 objectivesUse core String methods: `length`, `substring`, `indexOf`, and `equals` · Compare Strings correctly with `.equals` rather than `==` · Predict the result of substring and index operations by counting positions
- Math Class & Wrapper Classes12 min · 3 objectivesCall static Math methods such as `abs`, `max`, `min`, and `pow` · Predict results of integer division and how it differs from double division · Recognize the Integer and Double wrapper classes for boxing primitives
Formulas in Unit 1
What examiners penalize here
- On the exam, `new` always appears with a class that has a matching constructor. If the arguments do not match any constructor’s parameter list, the code fails to compile — check the number and types of arguments carefully.
- When you see chained calls, rewrite them as separate steps on scratch paper: compute the leftmost call, replace it with its result, and repeat. This prevents mis-reading `s.trim().length()` as calling `length()` on the original spaced string.
- For any `indexOf` or `substring` question, write the string out and label each character with its index starting at 0. Counting on paper prevents off-by-one mistakes with the excluded end index.
- `Math` methods are static: always call them as `Math.name(...)`, never on an object. And watch the return type — `Math.pow` returns a `double`, so `Math.pow(2, 3)` is `8.0`, not `8`.
Practice CS A
Our practice bank is drawn from across the whole course rather than filtered to one unit, which is closer to how the exam asks anyway — it will not tell you which unit a question is testing.
Questions about this unit
How much of the AP Computer Science A exam is Unit 1?
Unit 1, Using Objects and Methods, is worth 15–25% of the CS A multiple-choice section according to the published course framework. Across all 4 units that makes it one of the heaviest units on the exam, and worth front-loading.
What topics are covered in CS A Unit 1?
Using Objects and Methods covers Objects & classes, Method calls, String methods and Math class & wrappers.
How should I study CS A Unit 1?
Read the 4 lessons below first — about 55 minutes — then work practice questions on these topics. Finish with practice questions and read the explanation for every one you get right by elimination as well as the ones you miss.
All 4 units of AP Computer Science A
Unit names, topics and exam weights follow the published College Board course framework for AP Computer Science A. AP® is a trademark registered by the College Board, which does not endorse this site.