Organizational Research By

Surprising Reserch Topic

how do i make 2 comparable methods in only one class using -'java,sorting,collections,comparable'


how do i make 2 comparable methods in only one class  using -'java,sorting,collections,comparable'

I've got one class, that I sort it already by one attribute.
Now I need to make another thing, that I need to create another way to sort my data.
How can I make it, so I can choose between the two methods.
The only command I know is Collections.sort that will pick up the method compareTo from the class I want to compare its data.

Is it even possible?
    

asked Sep 7, 2015 by rajesh
0 votes
8 views



Related Hot Questions

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

...