Way to specify multiple interfaces in Java

后端 未结 6 814
清酒与你
清酒与你 2020-12-29 10:04

I have two interfaces, HasClickHandlers and DoesFancyFeedback. Then I have some UI objects that implement both interfaces - for example, a B

6条回答
  •  轮回少年
    2020-12-29 10:39

    I do not think that there is a better way to do what you want. I just wanted to suggest you to do the following. You can create method (let's call it foo) that accepts argument that requires 2 interfaces:

     void foo(T arg);
    

    Please pay attention on one ampersand between 2 your interfaces.

提交回复
热议问题