Sorting

AP Computer Science A· difficulty 4/5

To sort an ArrayList<Integer>:

  • A

    Both work (Collections.sort delegates)

    check_circle
  • B

    list.sortAscending()

  • C

    list.sort(null)

  • D

    Collections.sort(list);

Explanation

Both work. Collections.sort uses natural ordering for Integer.

Want 10 more like this — adaptive to your weak spots?

Related questions