1import java.util.UUID;
2
3public class RandomStringUUID {
4 public static void main(String[] args) {
5 // Creating a random UUID (Universally unique identifier).
6 UUID uuid = UUID.randomUUID();
7 String randomUUIDString = uuid.toString();
8
9 System.out.println("Random UUID String = " + randomUUIDString);
10 System.out.println("UUID version = " + uuid.version());
11 System.out.println("UUID variant = " + uuid.variant());
12 }
13}
14