If Java would have allowed having two abstract methods, then lambda expression would be required to provide an implementation of both the methods. Because, calling method won't know, which method to call out of those 2 abstract methods. It could have called the one which is not implemented. For example
If Java would have allowed this kind of functional interface
@FunctionalInterface
interface MyInterface {
void display();
void display(int x, int y);
}
Then on implementing the following would have not been possible.
public class LambdaExpression {
public static void main(String[] args) {
MyInterface ref = () -> System.out.print("It is display from sout");
ref.display(2, 3);
}
}
Since display(int x, int y) is not implemented, it will give the error. That is why the functional interface is a single abstract method interface.