View Single Post
  #1 (permalink)  
Old 08-01-2007, 06:08 PM
barney barney is offline
Member
 
Join Date: Jul 2007
Posts: 40
barney is on a distinguished road
Using Comparable and Comparator interfaces
Hi, 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?

Thanks.
Reply With Quote
Sponsored Links