Java Hash Code Calculate hashCode(Object obj)

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

Description

Returns a hash code for a possibly null object.

License

LGPL

Parameter

Parameter Description
obj object or null

Return

hash value

Declaration

public static int hashCode(Object obj) 

Method Source Code

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

public class Main {
    /**/* w  ww .  ja va2s .co  m*/
     * Returns a hash code for a possibly null object.
     *
     * @param   obj  object or null
     * @return   hash value
     */
    public static int hashCode(Object obj) {
        return obj == null ? 0 : obj.hashCode();
    }
}

Related

  1. hashCode(Object array)
  2. hashCode(Object o)
  3. hashCode(Object o)
  4. hashCode(Object o)
  5. hashCode(Object o1, Object o2)
  6. hashcode(Object obj)
  7. hashCode(Object obj)
  8. hashCode(Object obj)
  9. hashCode(Object obj)