lundi 25 janvier 2021

how can I Get Index Of The Shuffled Item After collections.shuffle if I shuffle the elements of the list?

arr=[2,3,1,1,4]
Collections.shuffle(arr)
println arr
firstElem= arr.first()
println firstElem

print:
[1,3,1,4,2]
1

I want to print position = 2

how can I print firstElem position? Please help




Aucun commentaire:

Enregistrer un commentaire