How to create a random number with a combination of 5 digits and charter flights
•
Java
I want to generate such a random number
> ADF1845CFT > ADF1864ATY > ADF18AT65Y
I successfully created a 5-digit number with numbers
I am using various solutions
> How to make combined random number matrix > Java random number with given length
Other methods
Through these methods, I created a successful random 5-digit number
Any help to appreciate
Solution
You can use random UUIDs
Example:
final String randomCode = UUID.randomUUID().toString(); // or you can play with the len... final String randomCode2 = UUID.randomUUID().toString().substring(0,5);
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码