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 explain that an object argument gives the parameter a copy of the reference, not a copy of the object. (Guide: “What does a method receive”; Practice Question 1)
- I can explain why a method can change the caller’s object but cannot change which object the caller’s variable refers to. (Guide: Consequences 1 and 2; Practice Questions 2 and 8)
- I can explain that a returned object is the same object, not a copy. (Guide: Consequence 3; Practice Questions 3 and 9)
- I can state when a method may access private data of a parameter. (Guide: Consequence 4; Practice Question 5)
Skills
- I can draw a reference diagram for a method call and use it to predict output. (Guide: Figure 1 and Worked example 1; Practice Questions 2 and 4)
- I can trace code that returns one of its object parameters and then changes it. (Guide: Worked example 2; Practice Question 3)
- I can write a method that returns a new object without changing its parameters. (Guide: Worked example 2; Practice Questions 6 and 7)
- I can find why a swap of two parameters has no effect on the caller. (Guide: Worked example 2; Practice Question 8)
Reasoning
- I can say what
==compares for object variables. (Practice Question 9) - I can justify why a method should not modify a mutable parameter unless required. (Guide: Consequence 2; Practice Question 6)
- I can explain the risk of aliasing through a returned reference. (Practice Question 9)
All ticked? Move on to the Topic 3.7 study guide, Class Variables and Methods, or return to the course roadmap.