Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class SortOf {
- public static void main(String[] args) {
- ArrayList<Integer> a = new ArrayList<Integer>();
- a.add(1); a.add(5); a.add(3);
- System.out.println(a);
- Collections.sort(a);
- System.out.println(a);
- a.add(2);
- System.out.println(a);
- Collections.reverse(a);
- System.out.println(a);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement