unique numbers from random class java code example Example: java random unique number String id = UUID.randomUUID().toString();