I'm trying to create an ID number for Map , so basically I have Customer class , and Map which will contain all the customers with String name , Double balance and int idNumber , the problem is that idNumber must be a collection of random numbers between 0-9 : example : 01019074902 . How can I do this ?
Asked
Active
Viewed 385 times
1 Answers
1
Its will generate 11 digit Random Numbers
long randomNumber = (long) Math.floor(Math.random() * 9_000_000_0000L) + 1_000_000_0000L;

sasikumar
- 12,540
- 3
- 28
- 48