posted 21 years ago
Steve,
I think can you can create a People class to hold these personal info.
A sample People class would look like
you then use a ArrayList to hold those People objects and
Collections.sort(List,Comparator) to sort the list & display
the result by some code like
For the list to be sorted the way you prefered, you need to define a
comparision mecnhanism & pass it to the Collections.sort() as 2nd parameter.
assume you want to sorting by last name, you declare a LastNameComp class
that implements the Comparator interface to sort lastName,
eg.
please follow Joe's suggestion about related API documentation,
I hope the above code segments can help you but not interfering with
your learning.
[ October 24, 2003: Message edited by: chi Lin ]
not so smart guy still curious to learn new stuff every now and then