Create UUID from java.util.UUID in Java

Description

The following code shows how to create UUID from java.util.UUID.

Example


/*from  w  w  w. j ava 2 s . c  o m*/
import java.util.UUID;

public class Main {
  public static void main(String arg[]) {
    System.out.println(UUID.randomUUID());
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    Development »




Java Algorithms
Java Clipboard
Java Compiler
Java Desktop
Java Virtual Machine
Java Math
OS
Random
Java Robot
Java RuntimeMXBean
Java Timer
Java UUID
Java Internationalization