-3

I'm trying to write a method that receives an ArrayList of Strings and puts it into alphabetical order. Is it possible to use the sort method for strings and not ints?

This is different from the other question because the way he did it is much more complicated than I'm aiming for. I just wanted a line of code rather than a whole block.

1 Answers1

0

I am not completely sure what are you trying to say by

not int s

But if you want to sort A arraylist of string alphabetically, this can be a way.

java.util.Collections.sort(arrayListOfString);
Diptopol Dam
  • 823
  • 1
  • 10
  • 39