Java UUID.hashCode() method example

Java UUID.hashCode() method example

By technicalkeeda, Views 474, Date 21-Feb-2018

In this tutorial, You will learn how to get the hash code value of this UUID.

tags Java

Returns a hash code for this UUID.


public int hashCode()


A hash code value for this UUID.

Java UUID hashCode() example

  • Initialize the String String name = "6224c18d-d004-11bd-984e-b8d80b2bdff8";
  • UUID.fromString(name); It creates a UUID from the string standard representation.
  • uuid.hashCode(); It returns the hashCode value associated with this UUID.
package com.technicalkeeda;

import java.util.UUID;

public class App {

    public static void main(String[] args) {

        String name = "6224c18d-d004-11bd-984e-b8d80b2bdff8";
        UUID uuid = UUID.fromString(name);

        System.out.println("The Hash Code value :-  " + uuid.hashCode());


The Hash Code value :-  558216976

Suggested Posts



Hi there! I am founder of and programming enthusiast. My skills includes Java,J2EE, Spring Framework, Nodejs, PHP and lot more. If you have any idea that you would want me to develop? Lets connect: yashwantchavan[at][]