Random UUID

In this chapter you will learn:

  1. Get a Random UUID

Get a Random UUID

UUID represents an immutable universally unique identifier (UUID). A UUID has a 128-bit value.

The following Java uses the java.util.UUID to generate a random immutable universally unique identifier.

import java.util.UUID;
//j  av a 2 s. com
public class Main {
  public static void main(String arg[]) {
    System.out.println(UUID.randomUUID());
  }
}

Output:

Next chapter...

What you will learn in the next chapter:

  1. Get the memory in your Java virtual machine
Home » Java Tutorial » Utility Classes
Java standard stream
Java system property get and set
Current time in millis second and nano second
Random UUID
JVM memory
JVM garbage collector
JVM shutting down
Processor count
OS system commands
Random class
Random value
Random value range
Compile Java source code
Timer and TimerTask