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 name the four parts of a class: header, instance variables, constructors and methods. (Guide: “The anatomy in code”; Practice Question 1)
- I can explain what
publicandprivateeach allow. (Guide: “Access: public and private”; Practice Questions 2 and 6) - I can explain encapsulation in terms of private data and public methods. (Guide: “Access: public and private”; Practice Question 9)
- I can explain that each object has its own copy of each instance variable. (Guide: Worked example 1; Practice Question 4)
Skills
- I can declare a class, its private instance variables, public constructor and public methods in the correct form. (Guide: Worked example 2; Practice Question 7)
- I can write a private helper method and call it from a public method. (Guide: Worked example 2; Practice Questions 5 and 6)
- I can trace the state of two objects of one class through a sequence of calls. (Guide: Worked example 1; Practice Questions 4 and 5)
- I can spot and fix an access error or a constructor written with a return type. (Guide: “What the compiler enforces”; Practice Questions 3 and 8)
Reasoning
- I can explain why a private instance variable is changed through a public method instead of directly. (Practice Question 9)
- I can decide whether a method should be public or private from how it will be used. (Guide: “Access: public and private”; Practice Question 6)
- I can explain why
voidin front of a constructor name changes what the code means. (Guide: “Common misconceptions”; Practice Question 8)
All ticked? Move on to the Topic 3.4 study guide, Constructors, or return to the course roadmap.