im by inserting thousands of numbers from a txt file into a list, and I want to sort them every 5 numbers. Is this possible, and if so, how can this be done?
public static void readFromFile(){
List<Integer> putInList = new ArrayList<Integer>();
int jNum;
TextIO.readFile("jokerNums.txt");
try{
do{
jNum = TextIO.getInt();
putInList.add(jNum);
} while(!TextIO.eof());
}
catch(IllegalArgumentException e){
}
TextIO.put(putInList);
}
I tried the for loop inside the do {} while loop, but its infinite. Just to mention the numbers I put in, 9785. Thank you in advance.
source
share