mercredi 2 décembre 2015

Java - rand.nextInt(range) + 1 breaks when range >=350

I allow the user to enter a size and a range value. When the range value exceeds 350, my code breaks. I can't find why that is.

for(int i = 0; i < size; i++){
    array[i] = rand.nextInt(range) + 1; 
}




Aucun commentaire:

Enregistrer un commentaire