Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Main {
- public static void main(String[] args){
- int[] a1 = new int[] {21, 23, 24, 40, 75, 76, 78, 77, 900, 2100, 2200, 2300, 2400, 2500};
- List<Integer> stud = new ArrayList<>();
- stud.add(3);
- stud.add(9);
- stud.add(5);
- stud.add(24);
- stud.add(64);
- stud.add(4);
- stud.add(34);
- System.out.println(stud.toString());
- Collections.sort(stud, new Comparator<Integer>() {
- @Override
- public int compare(Integer o1, Integer o2) {
- return o2 - o1;
- }
- });
- System.out.println(stud.toString());
- }
- }
Add Comment
Please, Sign In to add comment