dimanche 10 septembre 2017

Java Random number between 100 and 500 which is a multiple of 10

I want to generate random number between two numbers which are multiples of 10. For example, between 100 and 500, I want to generate a uniform distribution of 110, 120 ... 490, 500.

I think it is better to use Random.nextInt() as per THIS post. But not sure how to do that.




Aucun commentaire:

Enregistrer un commentaire