File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Cattle Drive and the fly likes OOP 3: SortNames Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "OOP 3: SortNames" Watch "OOP 3: SortNames" New topic
Author

OOP 3: SortNames

bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
I have a question about the SortNames assignment. I have it all working except for the sort by last name, as I am finding out this is the hardest part of the project.
When you say don't modify the Strings in the ArrayList, does that mean I can't make a copy of the ArrayList and modify those Strings. Basically I was thinking of taking a copy of the list, chopping off the first name, sorting it, and then comparing it back to the old array to print it in order. Is there an easier way or a class or method I am missing?
Thanks,
Bill
bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
Actually I found a slightly easier way, but I am still creating my own methods and not using something from the API.
Bill
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Rather than create a new list, the purpose of the assignment is for you to use the existing list and force a new way to do the sorting.� Take a look at an alternative way to call Collections.sort()

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
Thanks Marilyn. I see it now. I have never used that method so it was nice to see how it works.
Bill
 
Don't get me started about those stupid light bulbs.
 
subject: OOP 3: SortNames
 
Similar Threads
SortNames..
SortNames
OOP-3 SortNames wording
SortNames Requirements
SortNames