Java Hash Code Calculate hashCode(Object object)

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

Description

Returns the hash code of the specified object or 0 if it's null.

License

Apache License

Declaration

public static int hashCode(Object object) 

Method Source Code

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

public class Main {
    /**/*from w w  w.ja v  a 2 s.c  om*/
     * Returns the hash code of the specified object or 0 if it's
     * <code>null</code>.
     */
    public static int hashCode(Object object) {
        if (object == null) {
            return 0;
        }
        return object.hashCode();
    }
}

Related

  1. hashCode(Object obj)
  2. hashCode(Object obj)
  3. hashCode(Object obj)
  4. hashCode(Object object)
  5. hashCode(Object object)
  6. hashCode(Object object)
  7. hashCode(Object objects[])
  8. hashCode(Object value)
  9. hashCode(Object value)