How could I make my code does not repeat any number generated randomly, was looking in the forum but can not find any examples that I can easily understand.
import java.util.*;
public class Lottery {
public static void main(String[] args) {
int n[] = {37};
Random rd = new Random();
for (int i = 0; i < n.length;i++){
for (int j=0; j <6;j++) {
System.out.println(rd.nextInt(n[i])+1);
}
}
}
}