Here you can find the source of hashCode(final Object object)
null
.
Parameter | Description |
---|---|
object | the object (<code>null</code> permitted). |
null
).
public static int hashCode(final Object object)
//package com.java2s; /*/*w w w .j av a2s.c om*/ * ======================================================================== * JCommon : a free general purpose class library for the Java(tm) platform * ======================================================================== * (C) Copyright 2000-2004, by Object Refinery Limited and Contributors. * Project Info: http://www.jfree.org/jcommon/index.html * This library is free software; you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Foundation; * either version 2.1 of the License, or (at your option) any later version. * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License along with this * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * ---------------- * ObjectUtils.java * ---------------- * (C) Copyright 2003, 2004, by Object Refinery Limited. * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; * $Id: ObjectUtils.java,v 1.1 2011-01-31 09:01:41 klukas Exp $ * Changes * ------- * 25-Mar-2003 : Version 1 (DG); * 15-Sep-2003 : Fixed bug in clone(List) method (DG); */ public class Main { /** * Returns a hash code for an object, or zero if the object is <code>null</code>. * * @param object * the object (<code>null</code> permitted). * @return The object's hash code (or zero if the object is <code>null</code>). */ public static int hashCode(final Object object) { int result = 0; if (object != null) { result = object.hashCode(); } return result; } }