Classes and Objects
A class is a blueprint defining fields and methods. An object is an instance created with new.
Example: Student s = new Student("Alice", 95);

Read the notes, then try the practice. It adapts as you go.When you're ready.
Session Length
~20 min
Adaptive Checks
18 questions
Transfer Probes
9
Object-oriented programming in Java centers on classes as blueprints and objects as instances. A class defines instance variables (fields), constructors, and methods. Constructors initialize object state and share the class name with no return type.
Encapsulation hides implementation by declaring fields private and providing public accessor (getter) and mutator (setter) methods. The this keyword refers to the current object instance.
Method signatures include return type, name, and parameter list. Static methods belong to the class, not instances. The toString() method provides a String representation. Scope and access modifiers (public, private) control visibility. This unit covers 5-7.5% of the AP CSA exam.
One step at a time.
Adjust the controls and watch the concepts respond in real time.
A class is a blueprint defining fields and methods. An object is an instance created with new.
Example: Student s = new Student("Alice", 95);
Special method with class name, no return type. Initializes object state. Default constructor has no params.
Example: public Student(String n, int g) { name=n; grade=g; }
Hiding implementation with private fields. Public getters/setters control access. Protects object state.
Example: private int age; public int getAge(){return age;} public void setAge(int a){if(a>0) age=a;}
Refers to current object instance. Resolves ambiguity between field and parameter names.
Example: public void setName(String name) { this.name = name; }
Static belongs to class (shared). Instance belongs to each object. Static accessed via ClassName.
Example: static int count; // shared. String name; // per object.
Return type + name + parameter list. Overloading: same name, different parameters.
Example: int add(int a, int b) vs double add(double a, double b)
Returns String representation. Called automatically in print statements and concatenation.
Example: public String toString() { return name + ": " + grade; }
Choose a different way to engage with this topic β no grading, just richer thinking.
Explore your way β choose one:
See how the key ideas connect. Nodes color in as you practice.
Walk through a solved problem step-by-step. Try predicting each step before revealing it.
This is guided practice, not just a quiz. Hints and pacing adjust in real time.
Small steps add up.
What you get while practicing:
The best way to know if you understand something: explain it in your own words.
More ways to strengthen what you just learned.