View Single Post
Old 08-09-2004, 02:16 PM   PM User | #1
rajeshnaidu
New to the CF scene

 
Join Date: Apr 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
rajeshnaidu is an unknown quantity at this point
Sort java objects in an Array

I have an array of Java objects(for example: Employee). I need to sort this array based on any one of the data variable(for example: emp_name, desg, salary) in the Java class.

I had done using Comparable and Comparator interfaces. But the problem here is need to handle both ascending and descending dynamically based on parameter passed.

Can anyone help me in this?

Thanking you in advance.
rajeshnaidu is offline   Reply With Quote