As indicated by others: you cannot. But you can extend the interfaces so you can create something like:
public interface InterfaceA { void methodA(); } public interface InterfaceB extends InterfaceA { void methodB(); }
This way you can use InterfaceA to implement classes with only one specific method and InterfaceB when you can use both methods.
But of course, it all depends on your design.
Lucas de oliveira
source share