To sort an ArrayList<Integer>:
- Acheck_circle
Both work (Collections.sort delegates)
- B
list.sortAscending()
- C
list.sort(null)
- D
Collections.sort(list);
Explanation
Both work. Collections.sort uses natural ordering for Integer.
AP Computer Science A· difficulty 4/5
To sort an ArrayList<Integer>:
Both work (Collections.sort delegates)
list.sortAscending()
list.sort(null)
Collections.sort(list);
Explanation
Both work. Collections.sort uses natural ordering for Integer.
Want 10 more like this — adaptive to your weak spots?