Java Collection Tutorial - Java Arrays.deepHashCode(Object [] a)


Arrays.deepHashCode(Object [] a) has the following syntax.

public static int deepHashCode(Object [] a)


In the following code shows how to use Arrays.deepHashCode(Object [] a) method.

//  ww w  .  j  av  a 2s  . co  m

import java.util.Arrays;

public class Main {

  public static void main(String[] args) {

   Object[] ob = { "java2s","" };
   // deephashcode for object ob
   int retval=Arrays.deepHashCode(ob);
   System.out.println("The Hash Code of ob is:" + retval);

The code above generates the following result.