Here you can find the source of hashCode(Object obj)
Parameter | Description |
---|---|
obj | an object |
public static int hashCode(Object obj)
//package com.java2s; /*// ww w . j ava 2 s. c om * Copyright (C) 2002-2017 FlyMine * * This code may be freely distributed and modified under the * terms of the GNU Lesser General Public Licence. This should * be distributed with the code. See the LICENSE file for more * information or http://www.gnu.org/copyleft/lesser.html. * */ public class Main { /** * Return a zero hashCode if the object is null, otherwise return the real hashCode * * @param obj an object * @return the hashCode, or zero if the object is null */ public static int hashCode(Object obj) { if (obj == null) { return 0; } return obj.hashCode(); } }