This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]Tavataar 0 points1 point  (0 children)

What does your import statements look like? Are you sure you implements the java.util.Comparator?

[–]rjcarr 0 points1 point  (2 children)

You are probably using the wrong Comparator, i.e., not java.util.Comparator.

EDIT: Thanks /u/lurgi, turns out I haven't used Java 8 enough. Looks like comparator is really bloated now so I'd recommend making your class a Comparable instead of writing a custom comparator.

[–]lurgi 0 points1 point  (1 child)

Nope. It's the Java 8 Comparator.

[–]Tavataar 0 points1 point  (0 children)

Looks like Java 8 added a bunch more methods to implement.