Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static int getHashCode(final byte... pBytes) {
        final int prime = 31;
        int result = 1;

        for (int i = 0; i < pBytes.length; i++) {
            result = prime * result + pBytes[i];
        }

        return result;
    }

    public static int getHashCode(final Object... pObjects) {
        final int prime = 31;
        int result = 1;

        for (int i = 0; i < pObjects.length; i++) {
            final Object object = pObjects[i];
            result = prime * result + ((object == null) ? 0 : object.hashCode());
        }

        return result;
    }
}