Java Arrays hashCode Object


Java Arrays hashCode Object

package com.codingdict;

import java.util.Arrays;

public class ArrayDemo {
   public static void main(String[] args) {

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

      // hashcode for value1
      int retval = ob.hashCode();

      // printing hash code value
      System.out.println("The hash code of value1 is: " + retval);

      // value2 for Object array
      ob = new Object[] { 3.5, 8.5 };

      // hashcode for value2
      retval = ob.hashCode();

      // printing hash code value
      System.out.println("The hash code of value2 is: " + retval);
   }
}