How Is A Comparator Interface A Functional Interface?

The Comparator interface is useful for defining sorting in a user-defined class. It is a functional interface, even though the Comparator interface contains two abstract classes. How? Let’s check the Comparator class from the java.util package. Now, you’ll notice that there are two abstract methods. Ideally, an interface can only be called a functional interface …

How Is A Comparator Interface A Functional Interface? Read More »