This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Compiled as it is, the result is: true, true The answer given is: true, false The explanation given by Dan is correct if the assignment of h4 is changed to h4=sb2.hashCode(). Moreover, I guess that's the only purpose of having sb2 in this question. Do you guys agree? I was very reluctant to report this out as I've studied almost all the questions on Dan's exams (except on Collections) and haven't found any other mistake so far. I won't be surprised if I'm missing something here. Most of the questions are unambiguous and explanations lucid (thanks to Dan). Thanks Harwinder
Harwinder, You are correct. That is an error. I intended to type sb2, but I typed sb1 instead. I will be uploading a new version of the exam very soon. The correction will be contained in that version. If you find any more errors, then please don't hesitate to report them. That's how exams are improved. Thank you!
Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>