Example usage for java.util Arrays hashCode

List of usage examples for java.util Arrays hashCode

Introduction

In this page you can find the example usage for java.util Arrays hashCode.

Prototype

public static int hashCode(Object a[]) 

Source Link

Document

Returns a hash code based on the contents of the specified array.

Usage

From source file:Main.java

public static void main(String[] args) {

    byte[] bval = new byte[] { 10, 45 };

    System.out.println(Arrays.hashCode(bval));
    System.out.println(bval.hashCode());

}

From source file:Main.java

public static void main(String[] args) {

    // initializing int array
    int[] ival = new int[] { 3, 5 };

    System.out.println(Arrays.hashCode(ival));
    System.out.println(ival.hashCode());
}

From source file:Main.java

public static void main(String[] args) {

    // initializing short array
    short[] sval = new short[] { 2 };

    System.out.println(Arrays.hashCode(sval));
    System.out.println(sval.hashCode());
}

From source file:Main.java

public static void main(String[] args) {

    // initializing long array
    long[] lval = new long[] { 87, 77 };

    System.out.println(Arrays.hashCode(lval));
    System.out.println(lval.hashCode());
}

From source file:Main.java

public static void main(String[] args) {

    // initializing char array
    char[] cval = new char[] { 'a', 'k' };

    System.out.println(Arrays.hashCode(cval));
    System.out.println(cval.hashCode());
}

From source file:Main.java

public static void main(String[] args) {

    // initializing Object array
    Object[] ob = new Object[] { 22, 7 };

    System.out.println(Arrays.hashCode(ob));
    System.out.println(ob.hashCode());
}

From source file:Main.java

public static void main(String[] args) {

    // initializing double array
    double[] dval = new double[] { 2.9, 1.7 };

    System.out.println(Arrays.hashCode(dval));
    System.out.println(dval.hashCode());
}

From source file:Main.java

public static void main(String[] args) {

    // initializing boolean array
    boolean[] bval = new boolean[] { true };

    System.out.println(Arrays.hashCode(bval));
    System.out.println(bval.hashCode());

}

From source file:Main.java

public static void main(String[] args) {

    // initializing float array
    float[] fval = new float[] { 32.1f, 55.4f };

    System.out.println(Arrays.hashCode(fval));
    System.out.println(fval.hashCode());
}

From source file:Main.java

public static int getJavaAlgorithmArrayHashCode(Object[] a) {
    return Arrays.hashCode(a);
}