Cross-Platform, Java

Generating unique IDs in Java

With the UUID class you can generate unique ids. The identifiers generated by UUID are universally unique identifiers. UUID is the fastest and easiest way to generate a unique ID in Java.

import java.util.UUID;
..
..
public String generateID(){
    return String.valueOf(UUID.randomUUID());
}
..