Here you can find the source of hashCode(Object value)
public static final int hashCode(Object value)
//package com.java2s; public class Main { /**/*from w ww . ja v a 2 s .com*/ * Returns the hashcode of the specified value. */ public static final int hashCode(Object value) { return (value == null) ? 0 : value.hashCode(); } /** * Returns the hashcode of the specified value. */ public static final int hashCode(int value) { return value; } /** * Returns the hashcode of the specified value. */ public static final int hashCode(long value) { return (int) value; } /** * Returns the hashcode of the specified value. */ public static final int hashCode(byte value) { return value; } /** * Returns the hashcode of the specified value. */ public static final int hashCode(short value) { return value; } /** * Returns the hashcode of the specified value. */ public static final int hashCode(char value) { return value; } /** * Returns the hashcode of the specified value. */ public static final int hashCode(double value) { return (int) value; } /** * Returns the hashcode of the specified value. */ public static final int hashCode(float value) { return (int) value; } /** * Returns the hashcode of the specified value. */ public static final int hashCode(boolean value) { return value ? 1 : 0; } }