As everybody knows, Java 8 have introduced functional programming to Java developers.
Such interfaces as Comparator
, Runnable
, Callable
and so on are functional.
As follows from definition: functional interfaces are interfaces that have only a single abstract method.
But for example the same interface Comparator
have more than one abstract methods:
int compare(T o1, T o2);
boolean equals(Object obj); // inherited from Object class
// and a lot of concrete methods more
Well, is there any strict rule of how to determine if the interface is functional, so that it can be used as the assignment target for a lambda expression or method reference?