a little problem I have , well I have to make an array which generates 50 numbers from 0 to 999 which I can manage that the problem lies with the part were the numbers generatet cant be the same here is what ive done so far





[CODE]
import java.util.Random;
public class ArrayRandom{
public static void main(String args[]
{
Random r = new Random();
int temp;
int arr[] = new int[50];
for(int i = 0; i < 50; i++)
{

temp = r.nextInt(999) + 1; // this will give you a random number between 0 to 999.

arr[i] = temp; //here we know that the number is unique, so we can put it inside arr[i]
}
for(int i = 0; i < 50; i++)
{
System.out.print(arr[i] + " ");
}
}


}
[\CODE]



if some one could help me this would be a great help thanx shane : )