jeudi 26 janvier 2017

How to generate random nextInt() without High value

How can I generate random integers who have to be greater than value 100 and no max value restriction?

For example:

int valueTwo = r.nextInt(1000-100)+100;

But my example have got max value 1000. Roughly speaking I need from 100 to infinity.




Aucun commentaire:

Enregistrer un commentaire