title: Math.random range using the size of an arraylist
body: <pre><code>public void pickWinner() {
        int last = list.size() - 1;
        int number = (int)Math.random()*last;
        System.out.println("And the winner is...");
        Student winner = list.get(number);
        System.out.println(winner);
  }
  </code></pre>
  
  <p>I am having problems generating a winner other than the first item in the ArrayList. I am thinking it is a problem with Math.random() because the size of my ArrayList seems to be correct, but it seems to only be generating 0's to get the first term in my ArrayList. What can I do to fix this problem?</p>