6 Replies Latest reply on Feb 10, 2008 4:42 PM by 807603

    How do I randomly pick any ArrayList index?


      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..?