I'm writing a program that is supposed to sort objects (people, companies, etc.) based on criteria like last name, then first name, then ID number, and so on. The objects being sorted implement compareTo in their classes. I set up my sort class using the quickSort method (well, I tried to) and can't figure out what is wrong with it. It is strange, because if I add two objects and try to sort them it works OK but if I add three or more something goes wrong...the program will just hang there with no error message (maybe an infinite recursion?) Any suggestions or pointing out of obvious flaws would be appreciated.
For reference, the objects being sorted to have compareTo methods similar to this:
Again, thanks for any help.
For reference, the objects being sorted to have compareTo methods similar to this:
Again, thanks for any help.