Advertisement
JeffGrigg

Untitled

Jan 6th, 2018
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.40 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class SortOf {
  4.     public static void main(String[] args) {
  5.         ArrayList<Integer> a = new ArrayList<Integer>();
  6.         a.add(1); a.add(5); a.add(3);
  7.         System.out.println(a);
  8.         Collections.sort(a);
  9.         System.out.println(a);
  10.         a.add(2);
  11.         System.out.println(a);
  12.         Collections.reverse(a);
  13.         System.out.println(a);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement