Here you can find the source of hashCode(Object o)
public static int hashCode(Object o)
//package com.java2s; // Use of this source code is governed by a BSD-style license that can be public class Main { /**//from w ww . j av a 2s. c o m * Returns the hash code of the object, handling |null|. */ public static int hashCode(Object o) { if (o == null) { return 0; } return o.hashCode(); } /** * Returns the hash code of the value. */ public static int hashCode(boolean o) { return o ? 1231 : 1237; } /** * Returns the hash code of the value. */ public static int hashCode(long o) { return (int) (o ^ (o >>> 32)); } /** * Returns the hash code of the value. */ public static int hashCode(float o) { return Float.floatToIntBits(o); } /** * Returns the hash code of the value. */ public static int hashCode(double o) { return hashCode(Double.doubleToLongBits(o)); } /** * Returns the hash code of the value. */ public static int hashCode(int o) { return o; } }