Here you can find the source of hashCode(boolean value)
boolean
value.
Boolean.hashCode()
implementation.
public static int hashCode(boolean value)
//package com.java2s; /*// www . j a v a 2 s .c o m * Copyright (c) 2000 - 2005 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. * * Contributors: * * Description: * */ public class Main { /** * Returns hash code for a <code>boolean</code> value. * * @return the integer <tt>1231</tt> if this value is * <tt>true</tt>; returns the integer <tt>1237</tt> if * value is <tt>false</tt>. These numbers are taken from * <code>Boolean.hashCode()</code> implementation. */ public static int hashCode(boolean value) { return (value ? 1231 : 1237); } /** * Returns hash code for the specified object or zero of the object * is <code>null</code>. * * @return zero if <code>value</code> is <code>null</code>, otherwise * the value returned by <code>value.hashCode()</code>. */ public static int hashCode(Object obj) { return ((obj == null) ? 0 : obj.hashCode()); } }