| Author |
Sort contents of elements of ArrayList
|
Shailesh Pillai
Ranch Hand
Joined: Jan 24, 2006
Posts: 78
|
|
Hello Ranchers, How to sort an ArrayList based on the contents of its elements? For instance this is myArrayList, After the arraylist is populated, i would like the arraylist to be displayed in a sorted form i.e. based on the empName (ascending or descending). Is there any way to achieve this...... Please help. Thanks in advance.
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
Search the Java SE Javadoc for the method sort in the class java.util.Collections. That should get you started. Let us know if you have questions. Also, please try to post to the appropriate forum. This is a basic java question, not a Struts question. I'm moving it to the Basic Java forum for you.
|
Merrill
Consultant, Sima Solutions
|
 |
 |
|
|
subject: Sort contents of elements of ArrayList
|
|
|