-
-
Save nullren/7ff41496090e7e920e23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lazily initialized, cached hashCode | |
private volatile int hashCode = 0; // (See Item 48) | |
public int hashCode() { | |
if (hashCode == 0) { | |
int result = 17; | |
result = 37*result + areaCode; | |
result = 37*result + exchange; | |
result = 37*result + extension; | |
hashCode = result; | |
} | |
return hashCode; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment