Is there any way u could generate random numbers into an array randomly?
Printable View
Is there any way u could generate random numbers into an array randomly?
Huh?
Random numbers in an array randomly?
To fill an array with random numbers:
Code:int[] array = new int[20];
Random rand = new Random();
for(int i=0;i<array.length;++i) {
array[i] = rand.nextInt();
}