Ask a Question
Advertise on boostr.in
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?
Sep 7, 2015
to add a comment.
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
To avoid this verification in future, please