Compute hash code for two integers, a char, and a string with Objects.hash - Java Object Oriented Design

Java examples for Object Oriented Design:Hash Code

Description

Compute hash code for two integers, a char, and a string with Objects.hash

Demo Code

import java.util.Objects;

public class Main {
  public static void main(String[] args) {
    /* w ww .java 2s.c  o m*/
    int hash = Objects.hash(10, 800, '\u21b9', "Hello");
    System.out.println("Hash Code is " + hash);

  }

}

Result


Related Tutorials