Domanda di colloquio di HCLTech

1) Difference between Array.sort() and Collection.sort()

Risposta di colloquio

Anonimo

9 gen 2019

Arrays.sort works for arrays which can be of primitive data type also. Collections.sort() works for objects Collections like ArrayList, LinkedList, etc. We can use Collections.sort() to sort an array after creating a ArrayList of given array items.

1