Objects, Methods, References, and Strings
This topic tests object construction, method calls, parameters, return values, aliases, null references, String methods, Math methods, and Java Quick Reference behavior.
How to study for AP Computer Science A
Build every answer by tracing Java state carefully: identify variables, objects, method calls, loops, collection indices, class responsibilities, and the exact output or return value.
Core concepts
Concept 1
Object questions require tracking reference values and object state separately.
Exam cue: Ask whether a method mutates an object, returns a value, or both.
Concept 2
String operations can be tricky because Strings are immutable.
Exam cue: Track aliases before deciding whether a change affects another reference.
Concept 3
Method-call questions depend on parameters, receiver object, return type, and side effects.
Exam cue: Use String indexes and substring bounds carefully.
Risk pitfalls and guardrails
Assuming a String method changes the original object.
Guardrail: Avoid answers that rely only on habit, ignore the stated source, skip safety or compliance steps, or choose convenience over the professional standard.
Calling an instance method on null.
Guardrail: Avoid answers that rely only on habit, ignore the stated source, skip safety or compliance steps, or choose convenience over the professional standard.
Ignoring a returned value that must be assigned.
Guardrail: Avoid answers that rely only on habit, ignore the stated source, skip safety or compliance steps, or choose convenience over the professional standard.
Memory anchors
Object
An object combines state and behavior through fields and methods.
Constructor
A constructor initializes a new object.
Method Call
A method call executes behavior using arguments and a receiver object when needed.
Return Value
A return value must be used or stored if the program needs it later.
Reference
A reference value identifies an object rather than storing the object itself.
Alias
Aliases are two references that refer to the same object.
String Immutability
String methods return new String values rather than changing the original String.
Null Reference
A null reference does not refer to an object and cannot call instance methods.
Checkpoint rule
Do the check-up only after you can summarize each concept in one sentence and identify one dangerous pitfall from memory.
Knowledge Check (after reading)
Short check-up to confirm understanding of this module.
Check-up Questions
Given String s = "Hello"; what does s.length() return?
Given String s = "computer"; what does s.substring(0, 3) return?
Answer all questions to submit.
Next step personalized recommendations
Continue learning
Move forward only after this module is stable.
What is Pass Harbor?
Completely free exam prep for 317 U.S. exams.
- Practice questions
- Flashcards
- Study guides
- Mock exams
- No registration
- No paywall
- Start instantly
“No more expensive exam prep. Quality study tools should be accessible to everyone.”
