Advertisement
mstranieri

Java Comparator

Oct 24th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.24 KB | None | 0 0
  1. Comparator<Product> ordinaPerPrezzo = new Comparator<Product>(){
  2.    
  3.     public int compare(Product p1, Product p2){
  4.        
  5.         Double fn1 = p1.getPrintablePrice();
  6.         Double fn2 = p2.getPrintablePrice();
  7.        
  8.         return fn1.compareTo(fn2);
  9.     }
  10. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement