Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Sorting

  Asked By: Clifton    Date: Jan 26    Category: Java    Views: 793
  

Would like to ask a question on sorting.

I have already created an array and inside the array
it consists of membership id and names.
I would like to sort using the names.. how should i do
tat?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Latasha Wilson     Answered On: Jan 26

Look at the following classes :

java.util.Collections
java.util.Comparator

So what you do is create a class and implement
Comparator, this does the actual sorting.

Then just do the following,

Collections.sort( LIST, COMPARATOR_CLASS );

 
Didn't find what you were looking for? Find more on Sorting Or get search suggestion and latest updates.




Tagged: