Collections vs Arrays regarding sort() What is the difference between these two regarding sort() method? I know Arrays\' sort() is using binary search for sort(), what about Co
As the other answers have said, you would use Collections.sort() when dealing with an object that implements the Collection interface and the Arrays.sort() method when dealing with an Array.
A related question is what type of data structures are better if you want to sort a set of values. If you need to use a List, then I would suggest using a LinkedList since insertions run in O(1) where something like an ArrayList would be O(n).
You could also opt for using a SortedSet if there will be no duplicates or having duplicates is unwanted. That way you don't have to bother with using an external sort method.