Collections vs Arrays regarding sort()

前端 未结 8 2002
北荒
北荒 2021-01-31 03:20

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

8条回答
  •  借酒劲吻你
    2021-01-31 03:51

    Use Arrays.sort() if you're dealing with an Array. Use Collections.sort() if you're dealing with something that implements the Collection interface (eg ArrayList).

提交回复
热议问题