Java Arrays hashCode Short


Java Arrays hashCode Short

package com.codingdict;

import java.util.Arrays;

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

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

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

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

      // value2 for short array
      sval = new short[] { 30, 50 };

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

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