Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
- Explanation: Revisiting the checkOut() and returnBook() Methods 1:42
- Solution: checkOut() and returnBook() Methods
- Explanation: A Better Way With Setters Methods 1:32
- Recap: A Better Way With Setter Methods
- Solution: A Better Way With Setter Methods
- Demo: Checking Out and Returning a Book 2:07
- Explanation: Charging Fines to Patrons 0:40
- Recap: Charging Fines to Patrons
- Solution: Charging Fines to Patrons
- Demo: Charging Fines to Patrons 2:34
- Checking Out and Returning a Book 3 questions
Instruction
Recap: A Better Way With Setter Methods
Switching to a Setter Method
To refactor our current methods to use a setter method for the out property instead, we have to make a few changes.
Firstly, the out property initialized in the constructor method needs to be changed to a βbacking propertyβ, _out.
The _out property looks a little funny because it has an underscore before the word βoutβ. The underscore indicates that it's a backin...