HTML Code:
import java.util.Random;
Public class ArrayRandom3
{
public static void main(String[] args)
{
Random r = new Random();
int array[] = new int[50];
int a = 0;
while (a < 50)
{
int random = r.nextInt(999);
array[a] = random;
// **********************
// make sure the numbers arnt the same here
//
// **********************
a++;
}
int i = 0;
for(int row = 0; row< 10; row++)
{
for(int c = 0; c<=4; c++)
{
System.out.format("%03d ", array[i]);
i++;
}
System.out.println("");
}
}
}
ok guys ive done most of the code but i cant do the loop to make sure the numbers in the array are not the same can you help me now?