Create a
unique ID in Java.
If you want
to create a globally unique ID that is globally unique, then use GUID strings.
In Java the
GUID strings are created with java.util.UUID.
//< unique ID >
UUID
Guid=java.util.UUID.randomUUID();
String sGUID=Guid.toString();
//</
unique ID >
|
Returns for
the random GUID or UUID
sGUID: e4ba1dfd-aef8-437b-ba9b-25bb0dc5e596
|
You can
create UUID IDs using the methods: UUID.fromString (own_ID) or
UUID.nameUUIDFromBytes (byte [] name) or the default UUID.randomUUID ()