Generates a hash code for a sequence of input values. The hash
code is generated as if all the input values were placed into an
array, and that array were hashed by calling Arrays.hashCode(Object[]).
This method is useful for implementing Object.hashCode() on objects containing multiple fields. For
example, if an object that has three fields, x,
y, and z, one could write:
@Override public int hashCode() {
return Objects.hash(x, y, z);
}
Warning: When a single object reference is supplied, the returned
value does not equal the hash code of that object reference. This
value can be computed by calling hashCode(Object).
values | the values to be hashed |
Arrays.hashCode(Object[]), List.hashCode
Diagram: Object