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 this holds a reference to the current object in an instance method or constructor. (Guide: “The object that is me”; Practice Question 1)
- I can explain why this.name = name works when a parameter has the same name as the instance variable. (Guide: Use 1; Practice Questions 2 and 9)
- I can explain why class methods have no this reference. (Guide: “The restriction”; Practice Question 5)
- I can say what == compares for object references, including this. (Guide: Use 3; Practice Question 3)
Skills
- I can write a constructor that uses this to set instance variables. (Guide: Use 1; Practice Questions 7 and 9)
- I can pass this as an argument so one object gives another a reference to itself. (Guide: Use 2; Practice Question 6)
- I can trace the value of this through several calls on different objects. (Guide: Worked example 1; Practice Question 4)
- I can trace a method that returns this and a chained call. (Guide: Worked example 2, Part B; Practice Question 8)
Reasoning
- I can explain how the same method code gives different results when called on different objects. (Guide: Worked example 1; Practice Question 4)
- I can find the bug in name = name and explain what the object holds as a result. (Practice Question 9)
- I can explain why a stored this reference equals the original variable under ==. (Guide: Worked example 2, Part A; Practice Question 6)
All ticked? Unit 3 is done: try the Unit 3 diagnostic and Unit 3 review, then move on to the Topic 4.1 study guide, Ethical and Social Issues Around Data Collection, or return to the course roadmap.