Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.20 KB | None | 0 0
  1. import java.util.Comparator;
  2. public class MaxComparator<K> implements Comparator<K> {
  3.     public int compare(K a, K b) throws ClassCastException {
  4.         return ((Comparable<K>)b).compareTo(a);
  5.     }
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement