By LearnAllStudents Editorial Team. Source check dates are listed below.
Official resources
Use the method description to predict a result
For String label = “graph”; label.substring(1, 4) gives “rap” because index 1 is included and index 4 is excluded. Draw the indices below the letters to see the boundary.
Try it yourself
What does “tutor”.substring(2, 5) produce?
Check your reasoning
“tor”. The call includes indices 2, 3 and 4. Index 5 is the end position and is excluded.
How a tutor would approach this
Look up a method only after predicting. For each method, write an ordinary case and an edge case. Compare your prediction with the official method description, then run a small Java test during revision.
Frequently asked questions
Where do I get the current sheet?
Follow the Java Quick Reference link on the College Board exam page.
Does it explain complete solutions?
It describes methods. You still need to decide how to apply them.
Can I use web search in Bluebook?
Rehearse with the supplied reference and follow College Board’s exam instructions.
What is a useful substring edge case?
Use equal start and end indices within the string’s permitted range to test the empty result.
Official sources
- College Board AP Computer Science A exam and Java Quick Reference (checked 2026-11-26)
- College Board AP Computer Science A sample questions (checked 2026-11-26)
Related pages
Try a free 30-minute demo
Work through a question with a tutor. No payment needed.
Request a free 30-minute demo