Java UUID.fromString(String name)

Syntax

UUID.fromString(String name) has the following syntax.

public static UUID fromString(String name)

Example

In the following code shows how to use UUID.fromString(String name) method.


//from   w ww  .j a  v  a2s.com


import java.util.UUID;

public class Main {
   public static void main(String[] args) {
      // creating UUID      
      UUID x = UUID.fromString("00000000-00000-0000-0000-0000000000000");
           
        
      // checking UUID value
      System.out.println("UUID value is: "+x);    
   }    
}

The code above generates the following result.