I made a command that selects a random position from a 2d array
int[][] nums= {{1,2,3},
{2,3,4},
{5,6,7}};
for(int i = 0; i < 5; i++) {
int num = nums[rand.nextInt(4)][rand.nextInt(4)];
System.out.println(num);
}
How can I make sure that when int num selects a position for the first time, it will never be able to select it again? Making the 5 random numbers different from each other.