A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
sort list values
Joined: Jan 08, 2010
Mar 06, 2013 16:24:00
Can anyone help me to get the least values from the List?
Here is the code below.
List lst = getvalues(
I have three values:lst.size() =3
I need to sort it and get the lowest value 25.
How would I do that in
Joined: Jan 03, 2004
Mar 06, 2013 16:41:44
Do you have a requirement to sort the list? Or just to get the smallest value?
If all you want is the smallest value, there's no need to sort.
If you want to sort, then
has a sort() method that takes a List parameter, or, if you need to write your own, google for
or check your textbook.
Once you've clarified your actual requirements and taken your best shot, post again, showing your efforts and asking a more specific question than, "How do I sort?"
It is sorta covered in the
JavaRanch Style Guide
subject: sort list values
HashMap and finding index difference
How to sort Map
Soting objects in collection
sort a csv file having phone numbers
Sorting a List of String Values
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013