public class startOrder {
public static void main(String[] args) {
int[] start = new int[45];
for(int i=0;i<start.length;i++)
{
start[i] = (int)(Math.random()*45);
}
for(int i=0;i<start.length;i++)
{
System.out.println(start[i]);
}
}
}
I want to make a simple program that just prints all random numbers between 1-45. The problem though is there's duplicate numbers among them, how can I make it to print numbers between 1-45 without any duplication. It's a program that generates a random start number.