mercredi 7 juin 2017

Error in Math.random() for arrayList

I'm sure this is a small, stupid error that I just can't see.
I'm getting a compiling error in this code:

private String setQuestions(){
int match = Math.floor(Math.random()*cities.length); }

in my length.

Compiling error is:

"Cannot find symbol symbol: variable length location: variable cities of type ArrrayList "

How can I fix this? I do want to use Math.random();

Also not sure if this makes a difference, but this is is being done within a String method.

Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire