+ 3
How can i read a text file and still sort the information in it using iterators in java?
assignment
4 Respostas
+ 4
You can use Scanner or BufferedReader to read info from file. Store it in an arrayList and then use Collections.sort() on the arrayList.
Also you can store it in an array and use an sorting algorithm like selection sort or quick sort.
If you have many details like the name, dob, etc, you probably have to store each attribute in its own array and then you can sort based on any attribute.
+ 3
I didn't understand your question. Could u give an example?
0
Let's say you are given a text file containing information about swimmers.It has swimmers name,date of birth,status which is qualified or did not qualify and time they finished swimming.The information is randomly inserted.
My question is how can i read and sort that information using java?
0
just learn to explore upon it and you will get the answer😊