Class Creation
What this unit covers
The topics below follow the published CS A course framework for Unit 3. This unit is worth 10–18% of the exam, so budget your time against that rather than against how long the unit takes to teach.
Lessons in this unit
- Writing Classes14 min · 3 objectivesIdentify the parts of a class: instance variables, a constructor, and methods · Trace object creation followed by method calls on that object · Distinguish methods that change state from methods that report it
- Instance Variables & this14 min · 3 objectivesExplain what the `this` keyword refers to inside a method · Use `this` to disambiguate a parameter from an instance variable · Recall the default values of uninitialized instance variables
- Encapsulation13 min · 3 objectivesExplain why instance variables are made `private` · Use public methods to read and modify private state safely · Recognize that accessing a private field from outside the class is illegal
- Inheritance Basics14 min · 3 objectivesUse `extends` to create a subclass that inherits a superclass’s members · Predict which method runs when a subclass overrides a superclass method · Call a superclass constructor with `super(...)`
Formulas in Unit 3
What examiners penalize here
- Track an object’s state across a sequence of calls by keeping a running note of each instance variable. Mutator calls change it; accessor calls only read it.
- Remember the split: **instance** variables default (int → 0, boolean → false, object → null), but **local** variables must be initialized before use or the code will not compile.
- On the exam, directly reading or writing a `private` field from outside its class is always an error. Legal access outside the class must go through a `public` method.
- A subclass inherits public methods but not private fields directly — it reaches them through inherited methods or by passing values up with `super(...)`. `super(...)` must be the first line of the subclass constructor.
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 3?
Unit 3, Class Creation, is worth 10–18% of the CS A multiple-choice section according to the published course framework. Across all 4 units that makes it a substantial share — heavier than an even split would give it.
What topics are covered in CS A Unit 3?
Class Creation covers Writing classes, Instance variables & this, Encapsulation and Inheritance basics.
How should I study CS A Unit 3?
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.