am new to programming and I just started doing a program where I want to generate and sort 20 unique random numbers, how ever I was only able to generate numbers which were not unique nor sorted using this script
import java.util.Random;
class FTW {
public static void main (String[]args){
Random I = new Random();
int number;
for(int counter=1; counter<=20;counter++){
number = I.nextInt(20);
System.out.println(number + " ");
}
}
}
Can any one help me edit this or can give me a better one that does the job and explain it to me if possible :)