java randomly generate an ID code example
Example 1: java generate random id
String id = UUID.randomUUID().toString();
Example 2: how to generate random id in java
import java.util.UUID;
public class UUIDExample.
{
public static void main(String[] args)
{
UUID uuid=UUID.randomUUID(); //Generates random UUID.
System.out.println(uuid);
}
}