Here you can find the source of hashCode(boolean b)
public static int hashCode(boolean b)
//package com.java2s; /******************************************************************************* * Copyright (c) 2003, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://from ww w . j a v a 2 s . c o m * IBM Corporation - initial API and implementation *******************************************************************************/ public class Main { public static int hashCode(boolean b) { return b ? Boolean.TRUE.hashCode() : Boolean.FALSE.hashCode(); } public static int hashCode(int i) { return i; } public static int hashCode(Object object) { return object != null ? object.hashCode() : 0; } }