Here you can find the source of hashCode(Object objects[])
Parameter | Description |
---|---|
objects | The objects to hash |
public static int hashCode(Object objects[])
//package com.java2s; /******************************************************************************* * Copyright (c) 2009, 2010 Cloudsmith Inc. 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 w w w . j a v a 2 s . c om * Cloudsmith Inc. - initial API and implementation *******************************************************************************/ public class Main { /** * Creates a combined hash for an array of objects. * @param objects The objects to hash * @return The combined hashCode of the objects. */ public static int hashCode(Object objects[]) { if (objects == null) return 0; int result = 1; int idx = objects.length; while (--idx >= 0) { Object object = objects[idx]; result = 17 * result + (object == null ? 0 : object.hashCode()); } return result; } }