How do I randomly pick any ArrayList index?
807603Feb 10 2008 — edited Feb 10 2008Hi,
My problem is that, I have an ArrayList with a number of entries in.. Each iteration that this ArrayList is read the ArrayList index should decrease by 1.
What I am trying to do though is randomly select an index within the ArrayList to get a value from.
Would I use Java's random function to generate a random number according to the size of the ArrayList.
Thus given me a random index..?