6.8
Lecture 23: More Field Assignment (Mutation)
Read these notes from a similar course at Northeastern University.
A few notes to add to what’s on that page:
Some of the code examples use throw new RuntimeException("Some error message"). This is a mechanism in Java for reporting errors that you, the programmer, define the error message for. We’ll talk more about exceptions before the end of the quarter.
Section 18.7 refers to a type IList<Book> that goes a bit beyond what we’ve covered so far, and also relies on understanding some of the reading earlier on in the Northeastern course. You’re not responsible for the content in this section, though it’s not bad for you to read it for the high-level points.