Skip to content

Modified hashCode slides and examples to update to new recipe #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sbhat98
Copy link

@sbhat98 sbhat98 commented Apr 18, 2018

According to the 2018 3rd edition of Effective Java, programmers should use the new wrapper class static hashCode() methods instead of the old formula. Updated the LaTeX of the slides and in-class examples accordingly.

@sbhat98 sbhat98 changed the title Modified hashCode slides to update to new recipe Modified hashCode slides and examples to update to new recipe Apr 18, 2018
% \vspace{-.05in}
% The basic idea is to add some {\tt int} value for each significant field. Joshua Bloch's recipe works well for Java's collections, but a crude approximation is also fine:
% \begin{enumerate}
% \item Initialize {\tt result} with a constant non-zero value, e.g., 17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change this to match the other (Initialize result with the hash code of the first significant field.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants