Java Hash Code Calculate hashCode(final Object obj)

Here you can find the source of hashCode(final Object obj)

Description

hash Code

License

Apache License

Parameter

Parameter Description
obj The object to return the hash code for

Return

The hash code for the given object. If null, 0 is used.

Declaration

public static int hashCode(final Object obj) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**//  www .  j a  va2  s  . com
     * @param obj The object to return the hash code for
     * @return The hash code for the given object. If null, 0 is used.
     */
    public static int hashCode(final Object obj) {
        return (obj == null ? 0 : obj.hashCode());
    }
}

Related

  1. hashcode(final int[] array)
  2. hashCode(final long l)
  3. hashCode(final long l)
  4. hashCode(final long v)
  5. hashCode(final Object obj)
  6. hashCode(final Object object)
  7. hashCode(final Object... array)
  8. hashCode(float value)
  9. hashCode(int base, int multiplier, boolean fastArrays, Object... relevantValues)