Hi, I just started working with java and I have probably an easy problem to solve.
I've made an array and I want to fill it with random integers from 0-39. Each integer can be used only once.
Here's the code:
for (i=0; i<40; i++)
{
kup[i] = (int)(Math.random() * 40);
for (j=0; j<40; j++)
{
if (j != i)
{
while (kup[i] == kup[j])
{
kup[i] = (int)(Math.random() * 40);
}
}
}
}