I have a couple of questions regarding this project, both related to the setter and getter methods,
Looking at the block of code starting on line 30:
this.isCheckedOut is assessing the current boolean value through the getter method.
!this.isCheckedOut is banging the boolean value and sending it to the setter method.
I’m challenged by the setter and getter methods having the same name, failing to understand how the data is flowing/communicating within the code. Are the above assumptions true?
The following set of code performs the same action:
line 32 is accessing and manipulating the _isCheckedOut directly.
In this project, the parent class declares the _isCheckedOut as false. Why would we have a setter method in this instance if the value is declared and is set to true/false? Is manipulating the _key directly this way considered poor practice because we’re manipulating without flowing through a setter method?
Thank you so much for any insight/help yall can offer.