Basically, let's say I have an int array that can contain 10 numbers. This means that I can store 0-9 in each of the indices (each number only once).
If I run the code below:
int[] num = new int[10];
for(int i=0;i<10;i++){
num[i]=i;
}
my array will look like this: [0], [1], ....., [8], [9]
But how do I randomize the assignment of a number each time I run the code? For example, I want the array to look something like this: [8], [1], [0] ..... [6], [3]
source
share