Re: The Java Tutorials: Home Page > Collections > Interfaces > Object Ordering: Comparators Dear Java Programmer:
I got lost on this. Can someone help me? Please comment. Thank you. this final Comparator Seniority is a variable? The ternary operator is doing??? There condition and then int or another condition to test which is also a ternary operator?static final Comparator<Employee> SENIORITY_ORDER = new Comparator<Employee>() { public int compare(Employee e1, Employee e2) { int dateCmp = e2.hireDate().compareTo(e1.hireDate()); if (dateCmp != 0) return dateCmp; return (e1.number() < e2.number() ? -1 : (e1.number() == e2.number() ? 0 : 1)); } }; Respects, JKid314159 http://existentialists.blogspot.com/ --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to javaprogrammingwithpassion@googlegroups.com To unsubscribe from this group, send email to javaprogrammingwithpassion-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---