Search code examples
javaarraylistalphabetical

java - alphabetical order (list)


Possible Duplicate:
Sort List Alphabetically

how do i store my inputs in alphabetical order, i am inputting names into an arraylist:

    persons.add(person);

How to do that?


Solution

  • Try this:

     java.util.Collections.sort(people);