java random unique key code example Example: java random unique key String id = UUID.randomUUID().toString();