Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package c;
- import java.util.Comparator;
- public interface Concert {
- String getBand();
- String getGenre();
- double getTicketPrice();
- int getTicketCount();
- void setTicketCount(int ticketCount);
- public static Comparator<Concert> comparator = new Comparator<Concert>() {
- public int compare(Concert c1, Concert c2) {
- double price1 = c1.getTicketPrice();
- double price2 = c2.getTicketPrice();
- return (int) (price1 - price2);
- }
- };
- }
Add Comment
Please, Sign In to add comment