> I have list that contains other lists
> List1(
> {"Vincent","DUBLIN",12}
> {"Stephan","MORGAN",36}
> {"Jule","STEPHEN",45}
> {"Elisabeth","POQUIN",86}
> )
I suggest you don't do that. Instead introduce a class to represent a
person.
> How can I make a stuff like : List1.sort(0) to sort by Name or
> List1.sort(2) to sort by age
You should use the Collections.sort(List,Comparator) method. You will
need to write a java.util.Comparator implementation that compares the
required field.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
Alan Krueger - 20 Sep 2005 03:45 GMT
>> I have list that contains other lists
>> List1(
[quoted text clipped - 6 lines]
> I suggest you don't do that. Instead introduce a class to represent a
> person.
Since this looks an awful lot like a homework assignment, it might be
deliberate. A great way to show why some approach is better is to make
someone do it the hard way first.