String id = UUID.randomUUID().toString();
import java.util.UUID; public class UUIDExample. { public static void main(String[] args) { UUID uuid=UUID.randomUUID(); //Generates random UUID. System.out.println(uuid); } }