-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.

0

1 Answer 1

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);
Sign up to request clarification or add additional context in comments.

1 Comment

Sorry it was originally ints but someone edited it to be int s

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.