ok so i need a code that can read a list of random numbers from a note pad and then sort them, i have it set that it reads the notepad that it is supposed to but how do i make it sort
// this is what the notepad file reads 8,9,7,6,5,4,10,3,2,1
and the code that reads it and prints it is this
public static void main(String []args)throws IOException{
File file = new File("num.txt");
FileInputStream fis = null;
BufferedInputStream bis = null;
DataInputStream dis = null;
try {
fis = new FileInputStream(file);
// Here BufferedInputStream is added for fast reading.
bis = new BufferedInputStream(fis);
dis = new DataInputStream(bis);
// dis.available() returns 0 if the file does not have more lines.
while (dis.available() != 0) {
// this statement reads the line from the file and print it to
// the console.
System.out.println(dis.readLine());
}
// dispose all the resources after using them.
fis.close();
bis.close();
dis.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
and it dose print the numbers
please help me