MCPcopy Create free account
hub / github.com/apna-college/Alpha / main

Method main

11_ArrayLists/Sorting.java:6–22  ·  view source on GitHub ↗
(String args[])

Source from the content-addressed store, hash-verified

4public class Sorting {
5
6 public static void main(String args[]) {
7 ArrayList<Integer> list = new ArrayList<>();
8 list.add(5);
9 list.add(3);
10 list.add(6);
11 list.add(7);
12 list.add(1);
13
14 //ascending order
15 Collections.sort(list);
16 System.out.println(list);
17
18 //descending order
19 Collections.sort(list, Collections.reverseOrder());
20 System.out.println(list);
21
22 }
23}

Callers

nothing calls this directly

Calls 1

addMethod · 0.45

Tested by

no test coverage detected