Fault in java random number generator program
<p>I tried to make a random generated seating chart. Here is the code:</p>

<pre><code>import java.lang.*;
import java.util.Random;
import java.util.Collections;

public class seatingchart
{
    /**
     * Constructor for objects of class seatingchat
     */
    public seatingchart()
    {
        String[] students = new String[24]; // initiliazes all students
        students[0] = "Paul";
        students[1] = "Lauren";
        ...
        students[23] = "blank";

        String[] group = new String[24]; // initializes all groups
        group[0] = "GroupA1";
        group[1] = "GroupA2";
        ...
        group[23] = "GroupL2";

        Random random = new Random();
    }

    public void assign(String[] students, String[] group, int x)
    {
        Random random = new Random();
        for(int i=0; i &lt; students.length; i++)
        {
            System.out.println(students[i] + "is in" + group[random.nextInt(group.length)]);
        } 
    }
}
</code></pre>

<p>Why does it fail to run?</p>
