All 4 CS A units
AP Computer Science A · Unit 3 of 4

Class Creation

10–18% of the exam4 lessons · 55 min

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.

Writing classesInstance variables & thisEncapsulationInheritance basics

Lessons in this unit

Formulas in Unit 3

A minimal class
class C { private T field; C(T v){ field = v; } T getField(){ return field; } }
Instance variable + constructor + accessor is the core shape of nearly every AP class.
this to resolve shadowing
public Point(int x) { this.x = x; }
`this.x` is the instance variable; the bare `x` is the parameter. `this` picks the field when the names collide.
Encapsulation pattern
private field + public getter/setter = controlled access
Data is hidden; all reads and writes flow through methods the class controls.
Subclass with super call
class Sub extends Super { Sub(){ super(args); } }
`super(args)` runs the superclass constructor first, initializing inherited fields before the subclass adds its own setup.

What examiners penalize here

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

  1. Unit 1 · Using Objects and Methods
  2. Unit 2 · Selection and Iteration
  3. Unit 3 · Class Creation
  4. Unit 4 · Data Collections

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.