At step 7 of the example is written:
In my opinion this is a typo and should be:At line 9, a new object is created and assigned to baz. Thus, bar stops pointing to obj 1 and starts pointing to obj 3 after the execution of this line.
Deshmukh, Hanumant. OCP Oracle Certified Professional Java SE 11 Programmer I Exam Fundamentals 1Z0-815: Study guide for passing the OCP Java 11 Developer Certification Part 1 Exam 1Z0-815 (pp. 97-98). Enthuware.At line 9, a new object is created and assigned to baz. Thus, baz stops pointing to obj 1 and starts pointing to obj 3 after the execution of this line.
Hardcopy Edition: build 1.13
Kindle Edition: build 1.20
I could not find this in the errata[1] under location "4.6.3", nor with search for "bar", "baz" and "garbage collection".
[1] https://enthuware.com/resources/ocp-jav ... ook-errata