interface FooBar extends Foo, Bar {}
interface Foo extends FooBar { default int bar() { throw new UnsupportedOperationException(); } }
Foo f = () -> 3;
But, assuming method
void doSomething(FooBar x) { ... }
doSomething(() -> 3);
doSomething((Foo)() -> 3);
But, assuming method
you can't call it like this: What you can do is call it like this: