Java Hash Code Calculate hashCode(Object o)

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

Description

Note that this method doesn't work for arrays currently.

License

Open Source License

Parameter

Parameter Description
o may be <code>null</code>

Return

hash code for o, as in Object.hashCode()

Declaration

public static int hashCode(Object o) 

Method Source Code

//package com.java2s;
//it under the terms of the GNU Affero General Public License as published by

public class Main {
    /**/*from   w  ww . ja  v a 2s .c o  m*/
     * Note that this method doesn't work for arrays currently.
     * @param o may be <code>null</code>
     * @return hash code for o, as in <code>Object.hashCode()</code>
     */
    public static int hashCode(Object o) {
        return (o == null) ? 0 : o.hashCode();
    }
}

Related

  1. hashCode(long x)
  2. hashCode(long[] a, int fromIndex, int toIndex)
  3. hashCode(Object a)
  4. hashCode(Object array)
  5. hashCode(Object o)
  6. hashCode(Object o)
  7. hashCode(Object o1, Object o2)
  8. hashCode(Object obj)
  9. hashCode(Object obj)