I’d like to use the somelist.sort() method to do this if possible.
I have a list containing objects, all objects have a member variable resultType that is an integer. I’d like to sort the list using this number.
How do I do this?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s another way to do the same thing that you will often see used:
You might also want to look at
sortedif you haven’t seen it already. It doesn’t modify the original list – it returns a new sorted list.