Java Arrays hashCode Char


Java Arrays hashCode Char

package com.codingdict;

import java.util.Arrays;

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

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

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

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

      // value2 for char array
      cval = new char[] { 'e', 'f', 'h' };

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

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