I am trying to write a program that asks the users for name and age, and then sorts them by age.I have found a tutorial here http://onjava.com/onjava/2003/03/12/java_comp.html#listing4
(scroll down and listing5 is the 2nd part of the program). I am trying to expand on this tutorial by asking the user for input, the input is then stored and sorted according to "age".
Im new to java, but i have attempted to increase the array size by incrementing it, (i created a array [i] and at the end the i is incremented) however when i do a this the lenght does not change at all(i checked in de-bug, the increment does work however the lenght is not altered, is it possible to change the lenght of an array once the program is running? If not is there a way around it?
If not ...
Could someone please show me an example similar to the tutorial above, however for arraylists, how to get user response and sort it. I'm not a total noob, i've been trying for 2 days to do it with no luck =/.. I guess what im asking is how to sort objects within an arraylist
thanks for any help on this matter,any help will be greatly be appreciated (been trying for so long :( )