I have no idea why you want to do this! What's wrong with sorting a copy? Remember that the copy array, like the original, is simply an array of references (like pointers) to the Strings; you won't copy the actual Strings unless you go out of your way so to do.
JamesCherrill
Posting Genius
6,371 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
JamesCherrill
Posting Genius
6,371 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
I'm getting really confused now... I just thought it would be a simple process...
There's no problem with an abstract superclass, as long as the superclass defines (but not necessarily implements)the public methods that you need for the comparator.
It may seem confusing while you're still getting into it, but when it's done and you look back you'll see how easy it was really:
1. define comparator (2 1-line methods)
2. define new arraylist as copy of original (1 short line)
3. call sort (1 short line).
Don't Panic
JamesCherrill
Posting Genius
6,371 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
The most important advice you can remember when you're learning is not to get overwhelmed, and break your task into smaller parts, like James has suggested. That way, you can look up how to do each individual part, if necessary, and you can make progress on the problem.
BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354