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
Stringobjects are created (literal or constructor) and thatStringis injava.lang. (Guide: “Strings are objects”) - I can explain that a
Stringis 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
compareToguarantees and whyequalsis used to compare content. (Guide: “Comparing strings”; Practice Questions 6 and 8)
Skills
- I can evaluate
length,substring(from, to),substring(from)andindexOfcalls 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
indexOfandsubstring. (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
substringand state its precondition. (Practice Question 11)
Reasoning
- I can explain why
word.substring(1);leaveswordunchanged and how to keep the result. (Guide: “Strings cannot be changed”; Practice Question 4) - I can say which
substringcalls are legal edge cases and which throw an exception. (Guide: “Out-of-range indices”; Practice Questions 7 and 11) - I can explain why
indexOfreturns-1and 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.