Java Arrays.hashCode(int[] a)

Syntax

Arrays.hashCode(int[] a) has the following syntax.

public static int hashCode(int[] a)

Example

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


/*from w  ww  .j  a va  2 s  .  com*/
import java.util.Arrays;

public class Main {

  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());
  }
}

The code above generates the following result.