Method return type to fulfill multiple interfaces
问题 Is it possible to specify a method which returns a object that implements two or multiple interfaces? Say we have the following interfaces: interface FooBar { [Foo] & [Bar] getFooBar(); } interface Foo { void doFoo(); } inteface Bar { void doBar(); } Implementors of FooBar need to provide the method getFooBar() that returns an instance of a type which fullfills Foo as well as Bar . What I tried so far is to do it with generics: interface FooBar { <T extends Foo & Bar> T getFooBar() } class