Hot to remember random value from array?
public int getRandomValue(){
int[] second = bubbleSort(convertToArr(generateUnique(10)));
int rnd = new Random().nextInt(second.length);
return second[rnd];
}
Above code return new random value with every call of this method.
How to mememorise random value? And not generate new one, I need this value for using it in further.
Aucun commentaire:
Enregistrer un commentaire