Work through the list without notes. If you cannot do a statement, follow its link, then come back. Guide = study guide; Practice = practice questions; see also the revision notes.
Understanding
- I can say that an array stores multiple values of the same type, primitive or reference. (Guide: “Why arrays?”; Practice Question 1)
- I can explain that an array’s length is fixed at creation and is read with the length attribute. (Guide: “Creating an array”; Practice Question 9)
- I can state the default value of every element of a new int, double, boolean and String array. (Guide: “Creating an array”; Practice Question 3)
- I can give the valid index range and say what happens outside it. (Guide: “Out-of-range indexes”; Practice Questions 2 and 6)
Skills
- I can create an array with new and with an initializer list. (Guide: “Creating an array”; Practice Questions 1 and 8)
- I can read and assign elements, including with a computed index. (Guide: Worked example 1; Practice Questions 4 and 5)
- I can swap two elements using a temporary variable. (Guide: Worked example 2, Part A; Practice Question 7)
- I can reach the last element without writing its position as a number. (Guide: “Accessing and changing elements”; Practice Question 8)
Reasoning
- I can explain why a null element in a String array cannot have a method called on it. (Guide: Worked example 2, Part B)
- I can explain why int[] b = a does not copy an array. (Guide: “Common misconceptions”)
- I can identify and fix the compile errors for length(), wrong element types and non-int indexes. (Guide: “Common misconceptions”; Practice Question 9)
All ticked? Move on to the Topic 4.4 study guide, Array Traversals, or return to the course roadmap.