I'm a little bit confused about why there is no such thing like lambda overloading.
I know lambda expression work with @FunctionalInterface
If you have two or more abstract method in interface then compiler can't decide what function to call when you are using a lambda expression, so it is necessary to have only one abstract method in the interface if you want to use a lambda expression. But what if you have two or more function with different arguments or a different type of arguments or return type than the compiler can easily decide what function to call.
For example:
interface Foo{
void show(String message);
void count(int number);
}
// Calling with lambda (Syntax is not correct)
x -> "Example Message"; // It should need to call void show();
x -> 7; // It should need to call void count();
Why this kind of thing is not available in java. isn't it a good thing.