Ivan_Bochev

Concert

Jun 17th, 2021 (edited)
689
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package mc;
  2.  
  3. import java.util.Comparator;
  4.  
  5. public interface Concert {
  6.     void performerInfo();
  7.  
  8.     String getBand();
  9.  
  10.     String getGenre();
  11.  
  12.     double getTicketPrice();
  13.  
  14.     int getTicketCount();
  15.  
  16.     void setTicketCount(int ticketCount);
  17.  
  18.     public static Comparator<Concert> comparator = new Comparator<Concert>() {
  19.         public int compare(Concert c1, Concert c2) {
  20.             double price1 = c1.getTicketPrice();
  21.             double price2 = c2.getTicketPrice();
  22.             return (int) (price1 - price2);
  23.         }
  24.     };
  25. }
  26.  
RAW Paste Data