dimanche 21 février 2016

random number generation in java with multiple of 1000 a number appear

I am looking to get random number in between 1000 to 8192000. The random number should be like 1000 , 2000,3000 to 8192000.

Following is the code that i have tried but did not got any success.

ran.nextInt(8192000 - 1000)%1000; 

What should I change in order to get number in term of 1000, 2000, 3000...




Aucun commentaire:

Enregistrer un commentaire