An interface defines a contract. If an interface defines a method
void foo() throws SomeException;
then it says: all implementing classes must have a method foo, returning void, not taking any argument, and which is allowed to throw SomeException but no other type of checkd exception.
The implementing method may of course choose to not throw any exception at all, since it would not violate the contract of the interface method. throws
means: this method might throw this exception in some circumstances.
So, a method declared as
public void foo();
in an implementing class is valid for the interface defined above.
So, in your example,
public int add(int a) throws Exception1
is a valid method declaration to override
int add(int a) throws Exception1
but is not valid for
int add(int a) throws Exception2
(unless of course Exception1 is a subclass of Exception2).
The only way, if there is no inheritance between Excption1 and Exception2, to implement both interfaces is to have a method that doesn't throw any exception. That is the only possibility to fullfill the two contracts.