Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.io.IOException;
  4. import java.util.Collections;
  5. import java.util.List;
  6.  
  7. public class Main {
  8.  
  9. public static void main(String[] args) throws IOException {
  10.  
  11. FileWork fileWork = new FileWork();
  12.  
  13. List<Automobilis> cars = fileWork.gatherCars();
  14.  
  15. for (int i = 0; i < cars.size() ; i++) {
  16. System.out.println(cars.get(i).toString());
  17. }
  18.  
  19. Collections.sort(cars, (a, b) -> b.compareTo(a));
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement