How do I call my methods correctly?
(Updated: see latest post!)
I have written a small program which is supposed to read in records of student marks stored in a text file. It is then supposed to print out the records, ordered alphabetically by surname.
I have done most of it... see here:
but am struggling to work out how I can sort the objects in the array into alphabetical order by comparing the surname variable of each array object...
...so if anyone has any hints about how I can do that, it would be greatly appreciated! :-)
...also it would be good to get some general feedback about how my code could be improved... (I do feel like I've written a lot of code in order to achieve something that sounds like it should be fairly simple...!)
How to use compareTo method
Argh, actually, scrap that! I have solved my first issue by putting "Record RecordArray; right at the top of my code, just below the Results class!
That's got rid of about 12 error messages all at once! :-)
The only thing I think I need to sort out now is how to correctly write my compareTo method...