Skip to content
Marlbridge

AP® Computer Science A · Unit 1 · Topic 1.15

String Manipulation: Checklist (Computer Science A 1.15)

A self-check list for String objects, immutability, concatenation, indices, length, substring, indexOf, equals and compareTo, linked to the guide sections and practice questions.

Work through the list without notes. If you cannot do a statement, follow its link, then come back. Guide = study guide; Practice = practice questions.

Understanding

  • I can say how String objects are created (literal or constructor) and that String is in java.lang. (Guide: “Strings are objects”)
  • I can explain that a String is immutable and that its methods return new values. (Guide: “Strings cannot be changed”; Practice Question 4)
  • I can explain how + and += combine strings with other values and why the order of evaluation matters. (Guide: “Joining strings with + and +=”; Practice Question 3)
  • I can state the range of valid indices and the exception thrown outside it. (Guide: “Indices and the String methods”; Practice Question 7)
  • I can say what compareTo guarantees and why equals is used to compare content. (Guide: “Comparing strings”; Practice Questions 6 and 8)

Skills

  • I can evaluate length, substring(from, to), substring(from) and indexOf calls by writing indices under the characters. (Guide: Worked example 1; Practice Questions 1, 2 and 5)
  • I can get a one-character string with substring(index, index + 1). (Guide: “Indices and the String methods”; Practice Question 9)
  • I can take a string apart with indexOf and substring. (Guide: Worked example 1; Practice Question 9)
  • I can trace a sequence of string statements in a table. (Guide: Worked example 2; Practice Question 10)
  • I can write a short method that uses substring and state its precondition. (Practice Question 11)

Reasoning

  • I can explain why word.substring(1); leaves word unchanged and how to keep the result. (Guide: “Strings cannot be changed”; Practice Question 4)
  • I can say which substring calls are legal edge cases and which throw an exception. (Guide: “Out-of-range indices”; Practice Questions 7 and 11)
  • I can explain why indexOf returns -1 and how to avoid using it as an index. (Guide: “Indices and the String methods”)

All done? Take the Unit 1 diagnostic, then the Unit 1 mixed review, or return to the course roadmap.

AP® and Advanced Placement® are trademarks registered by the College Board, which is not affiliated with, and does not endorse, this website. Marlbridge is an independent tuition provider. It is not an authorized AP course provider, an AP school or an exam centre, and these resources are not official College Board materials. Reading them or doing simulations does not meet the laboratory requirement of an AP science course.