Using java.util.UUID : UUID « Development « Java Tutorial






import java.util.UUID;

public class Main {
  public static void main(String arg[]) {
    System.out.println(UUID.randomUUID());
  }
}
//138a4222-e898-484f-8347-dafc01c5b03b








6.54.UUID
6.54.1.Get a unique identifier Using java.rmi.dgc.VMID
6.54.2.Using java.util.UUID
6.54.3.Using java.util.concurrent.AtomicLong: A numerical id, start at zero and increment by one.
6.54.4.Create your own basic UUID
6.54.5.Random GUID
6.54.6.Session ID generator
6.54.7.Generates a UUID
6.54.8.ID generator
6.54.9.Generator for Globally unique Strings
6.54.10.Generates random UUIDs
6.54.11.UUID generator